change to a switch statement to avoid object comparison (#2507)

This commit is contained in:
Sam Freund
2026-05-25 22:39:38 -04:00
committed by GitHub
parent be27bb9916
commit d3de87f72b

View File

@@ -150,14 +150,15 @@ public enum Platform {
public static String getNativePlatform() { public static String getNativePlatform() {
String platPath = CombinedRuntimeLoader.getPlatformPath(); String platPath = CombinedRuntimeLoader.getPlatformPath();
if (platPath == "/linux/x86-64/") { switch (platPath) {
return "linuxx64"; case "/linux/x86-64/":
} else if (platPath == "/windows/x86-64/") { return "linuxx64";
return "winx64"; case "/windows/x86-64/":
} else if (platPath == "/linux/arm64/") { return "winx64";
return "linuxarm64"; case "/linux/arm64/":
} else { return "linuxarm64";
return ""; default:
return "";
} }
} }