From: David ‘Bombe’ Roden Date: Thu, 4 Jul 2013 17:29:24 +0000 (+0200) Subject: Use fluent iterable for filtering. X-Git-Tag: 0.8.6^2~12 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ce58ae7224b867106e255b5b8c345817dd3ed094;p=Sone.git Use fluent iterable for filtering. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 03d331d..7232b72 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -92,7 +92,6 @@ import net.pterodactylus.util.thread.NamedThreadFactory; import com.google.common.base.Optional; import com.google.common.base.Predicate; import com.google.common.base.Predicates; -import com.google.common.collect.Collections2; import com.google.common.collect.FluentIterable; import com.google.common.collect.HashMultimap; import com.google.common.collect.ImmutableSet; @@ -361,13 +360,13 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, @Override public Collection getLocalSones() { synchronized (sones) { - return Collections2.filter(sones.values(), new Predicate() { + return FluentIterable.from(sones.values()).filter(new Predicate() { @Override public boolean apply(Sone sone) { return sone.isLocal(); } - }); + }).toSet(); } } @@ -402,13 +401,13 @@ public class Core extends AbstractService implements SoneProvider, PostProvider, @Override public Collection getRemoteSones() { synchronized (sones) { - return Collections2.filter(sones.values(), new Predicate() { + return FluentIterable.from(sones.values()).filter(new Predicate() { @Override public boolean apply(Sone sone) { return !sone.isLocal(); } - }); + }).toSet(); } }