From aeadf6bba71f3e70d36fea3b349235504bea4a2f Mon Sep 17 00:00:00 2001 From: "Breno A." Date: Sun, 9 Jun 2024 09:45:05 -0300 Subject: [PATCH] perf: equals "" can be isEmpty here --- src/main/java/emu/grasscutter/scripts/data/SceneGroup.java | 2 +- src/main/java/emu/grasscutter/server/game/GameServer.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/emu/grasscutter/scripts/data/SceneGroup.java b/src/main/java/emu/grasscutter/scripts/data/SceneGroup.java index 0c2c253d8..de1a0ef8c 100644 --- a/src/main/java/emu/grasscutter/scripts/data/SceneGroup.java +++ b/src/main/java/emu/grasscutter/scripts/data/SceneGroup.java @@ -89,7 +89,7 @@ public final class SceneGroup { this.bindings = ScriptLoader.getEngine().createBindings(); CompiledScript cs; - if (overrideScriptPath != null && !overrideScriptPath.equals("")) { + if (overrideScriptPath != null && !overrideScriptPath.isEmpty()) { cs = ScriptLoader.getScript(overrideScriptPath, true); } else { cs = diff --git a/src/main/java/emu/grasscutter/server/game/GameServer.java b/src/main/java/emu/grasscutter/server/game/GameServer.java index ecd6b1425..7c09a3037 100644 --- a/src/main/java/emu/grasscutter/server/game/GameServer.java +++ b/src/main/java/emu/grasscutter/server/game/GameServer.java @@ -184,7 +184,7 @@ public final class GameServer extends KcpServer implements Iterable { private static InetSocketAddress getAdapterInetSocketAddress() { InetSocketAddress inetSocketAddress; - if (GAME_INFO.bindAddress.equals("")) { + if (GAME_INFO.bindAddress.isEmpty()) { inetSocketAddress = new InetSocketAddress(GAME_INFO.bindPort); } else { inetSocketAddress = new InetSocketAddress(GAME_INFO.bindAddress, GAME_INFO.bindPort);