mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-14 04:02:00 +01:00
Most palettes stay unused, do not pre-size them
This commit is contained in:
parent
9a138d0749
commit
ba8667a361
@ -46,10 +46,9 @@ final class PaletteImpl implements Palette, Cloneable {
|
||||
this.valuesPerLong = Long.SIZE / bitsPerEntry;
|
||||
this.hasPalette = bitsPerEntry <= maxBitsPerEntry;
|
||||
|
||||
final int initialCapacity = maxPaletteSize(bitsPerEntry) / 4;
|
||||
this.paletteToValueList = new IntArrayList(initialCapacity);
|
||||
this.paletteToValueList = new IntArrayList(1);
|
||||
this.paletteToValueList.add(0);
|
||||
this.valueToPaletteMap = new Int2IntOpenHashMap(initialCapacity);
|
||||
this.valueToPaletteMap = new Int2IntOpenHashMap(1);
|
||||
this.valueToPaletteMap.put(0, 0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user