3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +01:00

Use a HashSet here as it is more appropriate for the situation.

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-08-28 21:24:49 -04:00
Ursprung 6f8dae3a7e
Commit 5773fe240b

Datei anzeigen

@ -12,7 +12,7 @@ import com.velocitypowered.api.scheduler.TaskStatus;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import java.util.ArrayList; import java.util.HashSet;
import java.util.IdentityHashMap; import java.util.IdentityHashMap;
import java.util.concurrent.*; import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
@ -21,8 +21,8 @@ public class VelocityScheduler implements Scheduler {
private final PluginManager pluginManager; private final PluginManager pluginManager;
private final ExecutorService taskService; private final ExecutorService taskService;
private final ScheduledExecutorService timerExecutionService; private final ScheduledExecutorService timerExecutionService;
private final Multimap<Object, ScheduledTask> tasksByPlugin = Multimaps.synchronizedListMultimap( private final Multimap<Object, ScheduledTask> tasksByPlugin = Multimaps.synchronizedMultimap(
Multimaps.newListMultimap(new IdentityHashMap<>(), ArrayList::new)); Multimaps.newSetMultimap(new IdentityHashMap<>(), HashSet::new));
public VelocityScheduler(PluginManager pluginManager) { public VelocityScheduler(PluginManager pluginManager) {
this.pluginManager = pluginManager; this.pluginManager = pluginManager;