mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-02 11:21:15 +01:00
Added list initial capacity
This commit is contained in:
parent
94279e2dbf
commit
0dd454985f
@ -61,8 +61,11 @@ public class PerGroupChunkProvider extends ThreadProvider {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The size of the final list, used as the initial capacity
|
||||||
|
final int size = neighboursGroups.stream().mapToInt(value -> value.size()).sum() + 1;
|
||||||
|
|
||||||
// Represent the merged group of all the neighbours
|
// Represent the merged group of all the neighbours
|
||||||
LongSet finalGroup = new LongArraySet();
|
LongSet finalGroup = new LongArraySet(size);
|
||||||
|
|
||||||
// Add the newly loaded chunk to the group
|
// Add the newly loaded chunk to the group
|
||||||
final long chunkIndex = ChunkUtils.getChunkIndex(chunkX, chunkZ);
|
final long chunkIndex = ChunkUtils.getChunkIndex(chunkX, chunkZ);
|
||||||
|
Loading…
Reference in New Issue
Block a user