mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 19:24:44 +02:00
Cleanup our iterators.
This commit is contained in:
@ -33,8 +33,8 @@ public class ChunkletUnloader implements Runnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
for (Iterator<Entry<Chunk, Integer>> it = unloadedChunks.entrySet().iterator() ; it.hasNext() ; ) {
|
||||
Entry<Chunk, Integer> entry = it.next();
|
||||
for (Iterator<Entry<Chunk, Integer>> unloadedChunkIterator = unloadedChunks.entrySet().iterator() ; unloadedChunkIterator.hasNext() ; ) {
|
||||
Entry<Chunk, Integer> entry = unloadedChunkIterator.next();
|
||||
Chunk chunk = entry.getKey();
|
||||
|
||||
if (!chunk.isLoaded()) {
|
||||
@ -46,7 +46,7 @@ public class ChunkletUnloader implements Runnable {
|
||||
continue;
|
||||
|
||||
mcMMO.placeStore.unloadChunk(chunk.getX(), chunk.getZ(), chunk.getWorld());
|
||||
it.remove();
|
||||
unloadedChunkIterator.remove();
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ public class ChunkletUnloader implements Runnable {
|
||||
}
|
||||
else {
|
||||
//Just remove the entry if the chunk has been reloaded.
|
||||
it.remove();
|
||||
unloadedChunkIterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user