diff --git a/.globalconfig b/.globalconfig index 32bea9725fd..380436704c5 100644 --- a/.globalconfig +++ b/.globalconfig @@ -848,7 +848,7 @@ dotnet_diagnostic.IDE0039.severity = silent dotnet_diagnostic.IDE0040.severity = warning # IDE0041: UseIsNullCheck -dotnet_diagnostic.IDE0041.severity = silent +dotnet_diagnostic.IDE0041.severity = warning # IDE0042: UseDeconstruction dotnet_diagnostic.IDE0042.severity = silent diff --git a/src/System.Management.Automation/engine/MshMemberInfo.cs b/src/System.Management.Automation/engine/MshMemberInfo.cs index 50d036a1bdd..88379f261d2 100644 --- a/src/System.Management.Automation/engine/MshMemberInfo.cs +++ b/src/System.Management.Automation/engine/MshMemberInfo.cs @@ -1971,7 +1971,7 @@ public bool Equals(PSMethodInvocationConstraints other) public override bool Equals(object obj) { - if (ReferenceEquals(null, obj)) + if (obj is null) { return false; } diff --git a/src/System.Management.Automation/engine/PSVersionInfo.cs b/src/System.Management.Automation/engine/PSVersionInfo.cs index 529374a58db..289f105987e 100644 --- a/src/System.Management.Automation/engine/PSVersionInfo.cs +++ b/src/System.Management.Automation/engine/PSVersionInfo.cs @@ -859,7 +859,7 @@ public int CompareTo(object version) /// public int CompareTo(SemanticVersion value) { - if ((object)value == null) + if (value is null) return 1; if (Major != value.Major)