mirror of
https://github.com/Minestom/Minestom.git
synced 2024-06-22 20:44:54 +02:00
Keep the array Object to allow reuse
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
ac4210d7d7
commit
f9b1ec8798
|
@ -295,7 +295,7 @@ public final class ViewEngine {
|
|||
synchronized (mutex) {
|
||||
final int size = size();
|
||||
if (size == 0) return EMPTY;
|
||||
Player[] array = new Player[size];
|
||||
Object[] array = new Object[size];
|
||||
AtomicInteger index = new AtomicInteger();
|
||||
forEach(player -> array[index.getAndIncrement()] = player);
|
||||
assert index.get() == size;
|
||||
|
|
Loading…
Reference in New Issue
Block a user