diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/ContentType.cs b/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/ContentType.cs index 925ed85ca..8b62d6c26 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/ContentType.cs +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/MS/Internal/ContentType.cs @@ -258,8 +258,8 @@ namespace MS.Internal // safe comparison because the _type and _subType strings have been restricted to // ASCII characters, digits, and a small set of symbols. This is not a safe comparison // for the broader set of strings that have not been restricted in the same way. - result = (String.Compare(_type, contentType.TypeComponent, StringComparison.OrdinalIgnoreCase) == 0 && - String.Compare(_subType, contentType.SubTypeComponent, StringComparison.OrdinalIgnoreCase) == 0); + result = string.Equals(_type, contentType.TypeComponent, StringComparison.OrdinalIgnoreCase) && + string.Equals(_subType, contentType.SubTypeComponent, StringComparison.OrdinalIgnoreCase); } return result; }