From: David ‘Bombe’ Roden Date: Tue, 28 May 2013 11:41:35 +0000 (+0200) Subject: Don’t use another thread if there actually are no sinks for a connection. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=2503d1e00696c7f4de94482c05b0faea582f42cc;p=sonitus.git Don’t use another thread if there actually are no sinks for a connection. --- diff --git a/src/main/java/net/pterodactylus/sonitus/data/Pipeline.java b/src/main/java/net/pterodactylus/sonitus/data/Pipeline.java index 45d20bf..66ee2e5 100644 --- a/src/main/java/net/pterodactylus/sonitus/data/Pipeline.java +++ b/src/main/java/net/pterodactylus/sonitus/data/Pipeline.java @@ -347,7 +347,7 @@ public class Pipeline implements Iterable { public Connection(Source source, Collection sinks) { this.source = source; this.sinks = sinks; - if (sinks.size() == 1) { + if (sinks.size() < 2) { executorService = MoreExecutors.sameThreadExecutor(); } else { executorService = Executors.newCachedThreadPool();