mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-25 09:59:49 -05:00
Optimize timerTaskList iterating
This commit is contained in:
1 parent
fd3aaecaf2
commit
064822b31e
1 file changed
+6
-4
@@ -636,12 +636,14 @@ public class QuickShop extends JavaPlugin {
|
||||
if (logWatcher != null) {
|
||||
logWatcher.close();
|
||||
}
|
||||
for (BukkitTask bukkitTask : timerTaskList) {
|
||||
if (!bukkitTask.isCancelled()) {
|
||||
bukkitTask.cancel();
|
||||
Iterator<BukkitTask> taskIterator = timerTaskList.iterator();
|
||||
while (taskIterator.hasNext()) {
|
||||
BukkitTask task = taskIterator.next();
|
||||
if (!task.isCancelled()) {
|
||||
task.cancel();
|
||||
}
|
||||
taskIterator.remove();
|
||||
}
|
||||
timerTaskList.clear();
|
||||
if (calendarWatcher != null) {
|
||||
calendarWatcher.stop();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user