Skip to content

Commit 09d42eb

Browse files
committed
Use nextInt() to avoid int wrapper
1 parent ae959a2 commit 09d42eb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bukkit/version/v1_18/src/main/kotlin/io/github/rothes/esu/bukkit/module/networkthrottle/chunkdatathrottle/v1_18/ChunkDataThrottleHandlerImpl.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,9 @@ class ChunkDataThrottleHandlerImpl: ChunkDataThrottleHandler,
445445
if (z != 0 ) pending.add(id - 0x010)
446446
if (z != 15) pending.add(id + 0x010)
447447
}
448-
for (i in pending.iterator()) {
448+
val iterator = pending.intIterator()
449+
while (iterator.hasNext()) {
450+
val i = iterator.nextInt()
449451
if (bvArr[i] and INVISIBLE == INVISIBLE) {
450452
invisible[i] = BV_INVISIBLE
451453
}
@@ -476,7 +478,9 @@ class ChunkDataThrottleHandlerImpl: ChunkDataThrottleHandler,
476478
if (z != 15) checkBlock(id + 0x010, Z_MINUS) else checkEdge(id - 0x010, Z_LAVA, Z_PLUS )
477479
checkBlock(id + 0x100, Y_MINUS)
478480
}
479-
for (i in pending.iterator()) {
481+
val iterator = pending.intIterator()
482+
while (iterator.hasNext()) {
483+
val i = iterator.nextInt()
480484
if (bvArr[i] and INVISIBLE == INVISIBLE) {
481485
invisible[i] = BV_INVISIBLE
482486
}

0 commit comments

Comments
 (0)