Cache enum .values() (#998)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
boubou19andgithub-actions[bot] authored and GitHub committed 2026-08-10 07:40:36 +02:00
1 parent a51836fe9b
commit 6c3db443d7
1 file changed
+6 -3
@@ -77,10 +77,13 @@ import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier;
*/
public class ItemInfo {
public static enum Layout {
public enum Layout {
HEADER,
BODY,
FOOTER
FOOTER;
public static final Layout[] VALUES = values();
}
public static final ArrayListMultimap<Layout, IHighlightHandler> highlightHandlers = ArrayListMultimap.create();
@@ -472,7 +475,7 @@ public class ItemInfo {
MovingObjectPosition mop) {
List<String> retString = new ArrayList<>();
for (ItemInfo.Layout layout : ItemInfo.Layout.values())
for (ItemInfo.Layout layout : Layout.VALUES)
for (IHighlightHandler handler : ItemInfo.highlightHandlers.get(layout))
retString = handler.handleTextData(itemStack, world, player, mop, retString, layout);