Prefer StringComparison over StringComparer when not using comparers (#870)
This commit is contained in:
parent
5c31f1f455
commit
e51da32e9d
|
|
@ -164,9 +164,10 @@ namespace Microsoft.AspNetCore.Routing.Internal
|
|||
return x.IsFallbackMatch.CompareTo(y.IsFallbackMatch);
|
||||
}
|
||||
|
||||
return StringComparer.Ordinal.Compare(
|
||||
return string.Compare(
|
||||
x.Match.Entry.RouteTemplate.TemplateText,
|
||||
y.Match.Entry.RouteTemplate.TemplateText);
|
||||
y.Match.Entry.RouteTemplate.TemplateText,
|
||||
StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ namespace Microsoft.AspNetCore.Routing.Matching
|
|||
{
|
||||
for (var i = 0; i < httpMethods.Count; i++)
|
||||
{
|
||||
if (StringComparer.OrdinalIgnoreCase.Equals(httpMethods[i], httpMethod))
|
||||
if (string.Equals(httpMethods[i], httpMethod, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue