From 5773fe240be35890c967d4b33a7e80a763869123 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Tue, 28 Aug 2018 21:24:49 -0400 Subject: [PATCH] Use a HashSet here as it is more appropriate for the situation. --- .../velocitypowered/proxy/scheduler/VelocityScheduler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/scheduler/VelocityScheduler.java b/proxy/src/main/java/com/velocitypowered/proxy/scheduler/VelocityScheduler.java index e3e7b342a..3e87ab911 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/scheduler/VelocityScheduler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/scheduler/VelocityScheduler.java @@ -12,7 +12,7 @@ import com.velocitypowered.api.scheduler.TaskStatus; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -import java.util.ArrayList; +import java.util.HashSet; import java.util.IdentityHashMap; import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicReference; @@ -21,8 +21,8 @@ public class VelocityScheduler implements Scheduler { private final PluginManager pluginManager; private final ExecutorService taskService; private final ScheduledExecutorService timerExecutionService; - private final Multimap tasksByPlugin = Multimaps.synchronizedListMultimap( - Multimaps.newListMultimap(new IdentityHashMap<>(), ArrayList::new)); + private final Multimap tasksByPlugin = Multimaps.synchronizedMultimap( + Multimaps.newSetMultimap(new IdentityHashMap<>(), HashSet::new)); public VelocityScheduler(PluginManager pluginManager) { this.pluginManager = pluginManager;