mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
change to a switch statement to avoid object comparison (#2507)
This commit is contained in:
@@ -150,14 +150,15 @@ public enum Platform {
|
||||
public static String getNativePlatform() {
|
||||
String platPath = CombinedRuntimeLoader.getPlatformPath();
|
||||
|
||||
if (platPath == "/linux/x86-64/") {
|
||||
return "linuxx64";
|
||||
} else if (platPath == "/windows/x86-64/") {
|
||||
return "winx64";
|
||||
} else if (platPath == "/linux/arm64/") {
|
||||
return "linuxarm64";
|
||||
} else {
|
||||
return "";
|
||||
switch (platPath) {
|
||||
case "/linux/x86-64/":
|
||||
return "linuxx64";
|
||||
case "/windows/x86-64/":
|
||||
return "winx64";
|
||||
case "/linux/arm64/":
|
||||
return "linuxarm64";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user