Avoid memory barrier on replace

This commit is contained in:
themode 2022-01-06 08:25:22 +01:00 committed by TheMode
parent c58d84bb5d
commit d93e302d2a

View File

@ -268,7 +268,7 @@ final class PaletteImpl implements Palette, Cloneable {
cache[index] = getPaletteIndex(newValue);
});
// Set values to final array
count.set(0);
count.setPlain(0);
setAll((x, y, z) -> {
final int index = count.getPlain();
count.setPlain(index + 1);