mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-05 18:32:28 +01:00
Remove useless map lookup
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
0e8c07a811
commit
aa33e2256c
@ -156,7 +156,9 @@ public final class ThreadDispatcher {
|
||||
while (true) {
|
||||
final Chunk chunk = chunkUpdateQueue.pollFirst();
|
||||
if (chunk == null) break;
|
||||
updateChunk(chunk);
|
||||
// Update chunk's thread
|
||||
ChunkEntry chunkEntry = chunkEntryMap.get(chunk);
|
||||
if (chunkEntry != null) chunkEntry.thread = retrieveThread(chunk);
|
||||
this.chunkUpdateQueue.addLast(chunk);
|
||||
if (++counter > size || System.currentTimeMillis() >= endTime)
|
||||
break;
|
||||
@ -201,14 +203,6 @@ public final class ThreadDispatcher {
|
||||
return threads.get(threadId);
|
||||
}
|
||||
|
||||
private void updateChunk(@NotNull Chunk chunk) {
|
||||
ChunkEntry chunkEntry = chunkEntryMap.get(chunk);
|
||||
if (chunkEntry == null) return;
|
||||
Collection<ChunkEntry> chunks = threadChunkMap.get(chunkEntry.thread);
|
||||
if (chunks == null || chunks.isEmpty()) return;
|
||||
chunkEntry.thread = retrieveThread(chunk);
|
||||
}
|
||||
|
||||
private void processLoadedChunks() {
|
||||
Chunk chunk;
|
||||
while ((chunk = chunkLoadRequests.poll()) != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user