diff --git a/src/ResGen/Program.cs b/src/ResGen/Program.cs index 6e25d9239e7..3359226a99e 100644 --- a/src/ResGen/Program.cs +++ b/src/ResGen/Program.cs @@ -147,7 +147,7 @@ namespace {0} {{ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] {4} static global::System.Resources.ResourceManager ResourceManager {{ get {{ - if (object.ReferenceEquals(resourceMan, null)) {{ + if (resourceMan is null) {{ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(""{1}.resources.{5}{3}"", typeof({0}).Assembly); resourceMan = temp; }} diff --git a/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs b/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs index 15e2495e4fd..033382a565b 100644 --- a/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs +++ b/src/System.Management.Automation/engine/Modules/PSModuleInfo.cs @@ -1606,7 +1606,7 @@ public bool Equals(PSModuleInfo x, PSModuleInfo y) if (object.ReferenceEquals(x, y)) return true; // Check whether any of the compared objects is null. - if (object.ReferenceEquals(x, null) || Object.ReferenceEquals(y, null)) + if (x is null || y is null) return false; bool result = string.Equals(x.Name, y.Name, StringComparison.OrdinalIgnoreCase) && diff --git a/src/System.Management.Automation/engine/MshMemberInfo.cs b/src/System.Management.Automation/engine/MshMemberInfo.cs index f60aa8f6f3e..451048e2018 100644 --- a/src/System.Management.Automation/engine/MshMemberInfo.cs +++ b/src/System.Management.Automation/engine/MshMemberInfo.cs @@ -1946,7 +1946,7 @@ internal static bool EqualsForCollection(ICollection xs, ICollection ys public bool Equals(PSMethodInvocationConstraints other) { - if (ReferenceEquals(null, other)) + if (other is null) { return false; } diff --git a/src/System.Management.Automation/engine/PSVersionInfo.cs b/src/System.Management.Automation/engine/PSVersionInfo.cs index 1378f0f0c5e..09f9829c289 100644 --- a/src/System.Management.Automation/engine/PSVersionInfo.cs +++ b/src/System.Management.Automation/engine/PSVersionInfo.cs @@ -907,9 +907,9 @@ public override int GetHashCode() /// public static bool operator ==(SemanticVersion v1, SemanticVersion v2) { - if (object.ReferenceEquals(v1, null)) + if (v1 is null) { - return object.ReferenceEquals(v2, null); + return v2 is null; } return v1.Equals(v2); diff --git a/src/System.Management.Automation/utils/tracing/SysLogProvider.cs b/src/System.Management.Automation/utils/tracing/SysLogProvider.cs index f3a899acb7d..54bd39a38ad 100755 --- a/src/System.Management.Automation/utils/tracing/SysLogProvider.cs +++ b/src/System.Management.Automation/utils/tracing/SysLogProvider.cs @@ -200,7 +200,7 @@ private bool ShouldLog(PSLevel level, PSKeyword keywords, PSChannel channel) { get { - if (object.ReferenceEquals(_resourceManager, null)) + if (_resourceManager is null) { _resourceManager = new global::System.Resources.ResourceManager("System.Management.Automation.resources.EventResource", typeof(EventResource).Assembly); }