Avoid unnecessary/unsafe field lookups

This commit is contained in:
themode 2022-02-13 07:28:50 +01:00
parent cc0c7e00b2
commit d08635dbc3

View File

@ -57,7 +57,8 @@ public interface Palette extends Writeable {
* Returns the maximum number of entries in this palette. * Returns the maximum number of entries in this palette.
*/ */
default int maxSize() { default int maxSize() {
return dimension() * dimension() * dimension(); final int dimension = dimension();
return dimension * dimension * dimension;
} }
@NotNull Palette clone(); @NotNull Palette clone();