Avoid recomputing palette

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

View File

@ -265,7 +265,7 @@ final class PaletteImpl implements Palette, Cloneable {
final int newValue = function.apply(x, y, z, value);
final int index = count.getPlain();
count.setPlain(index + 1);
cache[index] = getPaletteIndex(newValue);
cache[index] = newValue != value ? getPaletteIndex(newValue) : value;
});
// Set values to final array
count.setPlain(0);