From d3de87f72b4794b43a7d2f17bf3c607cfd68b193 Mon Sep 17 00:00:00 2001 From: Sam Freund Date: Mon, 25 May 2026 22:39:38 -0400 Subject: [PATCH] change to a switch statement to avoid object comparison (#2507) --- .../photonvision/common/hardware/Platform.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/photon-targeting/src/main/java/org/photonvision/common/hardware/Platform.java b/photon-targeting/src/main/java/org/photonvision/common/hardware/Platform.java index 340eed92a..784c4e0b0 100644 --- a/photon-targeting/src/main/java/org/photonvision/common/hardware/Platform.java +++ b/photon-targeting/src/main/java/org/photonvision/common/hardware/Platform.java @@ -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 ""; } }