From dcb4aaac21b759e48e15e7ccaaffd9d38cbaf2ac Mon Sep 17 00:00:00 2001 From: Sean Gilligan Date: Fri, 9 Dec 2022 17:33:32 -0800 Subject: [PATCH] NativeDriver: replace .indexOf() with .contains() --- .../github/eduramiba/webcamcapture/drivers/NativeDriver.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/eduramiba/webcamcapture/drivers/NativeDriver.java b/src/main/java/com/github/eduramiba/webcamcapture/drivers/NativeDriver.java index 8473648..f1646f5 100644 --- a/src/main/java/com/github/eduramiba/webcamcapture/drivers/NativeDriver.java +++ b/src/main/java/com/github/eduramiba/webcamcapture/drivers/NativeDriver.java @@ -15,9 +15,9 @@ public class NativeDriver implements WebcamDriver { public NativeDriver() { final String os = System.getProperty("os.name", "generic").toLowerCase(Locale.ENGLISH); - if ((os.indexOf("mac") >= 0) || (os.indexOf("darwin") >= 0)) { + if ((os.contains("mac")) || (os.contains("darwin"))) { this.driver = new AVFDriver(); - } else if (os.indexOf("win") >= 0) { + } else if (os.contains("win")) { this.driver = new CaptureManagerDriver(); } else { throw new IllegalStateException("Unsupported OS = " + os);