Merge pull request #13 from msgilligan/msgilligan-NativeDriver-os.contains

NativeDriver: replace .indexOf() with .contains()
This commit is contained in:
Eduardo Ramos 2022-12-12 17:02:34 +01:00 committed by GitHub
commit 15b96b208d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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);