perf: simplify optional chain

This commit is contained in:
Breno A. 2024-06-09 09:58:25 -03:00
parent f01da54eaa
commit 8f8a6a7bfe

View File

@ -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);