From aecf79c987d643228f420ec26f89d84fff553336 Mon Sep 17 00:00:00 2001 From: Lyfts <127234178+Lyfts@users.noreply.github.com> Date: Wed, 16 Oct 2024 17:16:37 +0200 Subject: [PATCH] chill with the enum[] allocations --- .../java/com/github/lunatrius/ingameinfo/value/Operation.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/lunatrius/ingameinfo/value/Operation.java b/src/main/java/com/github/lunatrius/ingameinfo/value/Operation.java index 350beba..5f3b35e 100644 --- a/src/main/java/com/github/lunatrius/ingameinfo/value/Operation.java +++ b/src/main/java/com/github/lunatrius/ingameinfo/value/Operation.java @@ -128,10 +128,12 @@ public String getValue(Value value) { } }; + public static final Operation[] VALUES = values(); + public abstract String getValue(Value value); public static Operation fromString(String str) { - for (Operation op : values()) { + for (Operation op : VALUES) { if (String.valueOf(op).equalsIgnoreCase(str)) { return op; }