File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
src/Http/Http.Extensions/src Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ namespace Microsoft.AspNetCore.Http.Extensions
1111 /// </summary>
1212 public static class UriHelper
1313 {
14- private const string ForwardSlash = "/" ;
15- private const string Pound = "#" ;
16- private const string QuestionMark = "?" ;
14+ private const char ForwardSlash = '/' ;
15+ private const char Hash = '#' ;
16+ private const char QuestionMark = '?' ;
1717 private const string SchemeDelimiter = "://" ;
1818
1919 /// <summary>
@@ -103,7 +103,7 @@ public static void FromAbsolute(
103103 path = new PathString ( ) ;
104104 query = new QueryString ( ) ;
105105 fragment = new FragmentString ( ) ;
106- var startIndex = uri . IndexOf ( SchemeDelimiter ) ;
106+ var startIndex = uri . IndexOf ( SchemeDelimiter , StringComparison . Ordinal ) ;
107107
108108 if ( startIndex < 0 )
109109 {
@@ -115,10 +115,9 @@ public static void FromAbsolute(
115115 // PERF: Calculate the end of the scheme for next IndexOf
116116 startIndex += SchemeDelimiter . Length ;
117117
118- var searchIndex = - 1 ;
118+ int searchIndex ;
119119 var limit = uri . Length ;
120-
121- if ( ( searchIndex = uri . IndexOf ( Pound , startIndex ) ) >= 0 && searchIndex < limit )
120+ if ( ( searchIndex = uri . IndexOf ( Hash , startIndex ) ) >= 0 && searchIndex < limit )
122121 {
123122 fragment = FragmentString . FromUriComponent ( uri . Substring ( searchIndex ) ) ;
124123 limit = searchIndex ;
You can’t perform that action at this time.
0 commit comments