From d08635dbc3bb09f990d834272d513ce63a8cf0cb Mon Sep 17 00:00:00 2001 From: themode Date: Sun, 13 Feb 2022 07:28:50 +0100 Subject: [PATCH] Avoid unnecessary/unsafe field lookups --- .../java/net/minestom/server/instance/palette/Palette.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minestom/server/instance/palette/Palette.java b/src/main/java/net/minestom/server/instance/palette/Palette.java index 2ef17292f..3e7465c97 100644 --- a/src/main/java/net/minestom/server/instance/palette/Palette.java +++ b/src/main/java/net/minestom/server/instance/palette/Palette.java @@ -57,7 +57,8 @@ public interface Palette extends Writeable { * Returns the maximum number of entries in this palette. */ default int maxSize() { - return dimension() * dimension() * dimension(); + final int dimension = dimension(); + return dimension * dimension * dimension; } @NotNull Palette clone();