mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-26 11:07:53 +01:00
Optimize palette clear
This commit is contained in:
parent
33e1b4b157
commit
0148ad9aaf
@ -154,12 +154,17 @@ final class PaletteImpl implements Palette, Cloneable {
|
|||||||
this.values = values = new long[(size + valuesPerLong - 1) / valuesPerLong];
|
this.values = values = new long[(size + valuesPerLong - 1) / valuesPerLong];
|
||||||
}
|
}
|
||||||
|
|
||||||
long block = 0;
|
if (placedAir) {
|
||||||
for (int i = 0; i < valuesPerLong; i++) {
|
Arrays.fill(values, 0);
|
||||||
block |= (long) value << i * bitsPerEntry;
|
this.count = 0;
|
||||||
|
} else {
|
||||||
|
long block = 0;
|
||||||
|
for (int i = 0; i < valuesPerLong; i++) {
|
||||||
|
block |= (long) value << i * bitsPerEntry;
|
||||||
|
}
|
||||||
|
Arrays.fill(values, block);
|
||||||
|
this.count = maxSize();
|
||||||
}
|
}
|
||||||
Arrays.fill(values, block);
|
|
||||||
this.count = placedAir ? 0 : maxSize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user