From 8f8a6a7bfeb72d85d03c5a9f76c16b26e8818029 Mon Sep 17 00:00:00 2001 From: "Breno A." Date: Sun, 9 Jun 2024 09:58:25 -0300 Subject: [PATCH] perf: simplify optional chain --- src/main/java/emu/grasscutter/scripts/ScriptLib.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/emu/grasscutter/scripts/ScriptLib.java b/src/main/java/emu/grasscutter/scripts/ScriptLib.java index 6eaac1849..2118ea861 100644 --- a/src/main/java/emu/grasscutter/scripts/ScriptLib.java +++ b/src/main/java/emu/grasscutter/scripts/ScriptLib.java @@ -1997,7 +1997,7 @@ public class ScriptLib { logger.debug("[LUA] Call DropSubfield with {}", printTable(table)); String subfield_name = table.get("subfield_name").toString(); var entity = getCurrentEntity(); - if (!entity.isPresent()) return -1; + if (entity.isEmpty()) return -1; entity.get().dropSubfield(subfield_name);