Don’t use another thread if there actually are no sinks for a connection.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 28 May 2013 11:41:35 +0000 (13:41 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 28 May 2013 11:41:35 +0000 (13:41 +0200)
src/main/java/net/pterodactylus/sonitus/data/Pipeline.java

index 45d20bf..66ee2e5 100644 (file)
@@ -347,7 +347,7 @@ public class Pipeline implements Iterable<ControlledComponent> {
                public Connection(Source source, Collection<Sink> sinks) {
                        this.source = source;
                        this.sinks = sinks;
-                       if (sinks.size() == 1) {
+                       if (sinks.size() < 2) {
                                executorService = MoreExecutors.sameThreadExecutor();
                        } else {
                                executorService = Executors.newCachedThreadPool();