зеркало из https://github.com/dotnet/wpf.git
Use string.Equals over string.Compare for improved performance (#9724)
This commit is contained in:
Родитель
0d959af105
Коммит
cae5cefd4d
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче