From df78159688a5824291ff95b0ae963fdf51f2bb3a Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sun, 13 Nov 2022 20:46:22 +0000 Subject: [PATCH] Merge null/pattern checks into complex pattern. --- Interop/DetectOS.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Interop/DetectOS.cs b/Interop/DetectOS.cs index 77351ac42..98145a0e9 100644 --- a/Interop/DetectOS.cs +++ b/Interop/DetectOS.cs @@ -238,8 +238,7 @@ public static class DetectOS goto default; case PlatformID.Win32NT: // From Windows 8.1 the reported version is simply falsified... - if(Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Major >= 2 || - Environment.OSVersion.Version.Major > 6) + if(Environment.OSVersion.Version.Major is 6 and >= 2 or > 6) return FileVersionInfo. GetVersionInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "KERNEL32.DLL")).ProductVersion;