File tree 1 file changed +6
-7
lines changed
src/Http/Http.Extensions/src 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
11
11
/// </summary>
12
12
public static class UriHelper
13
13
{
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 = '?' ;
17
17
private const string SchemeDelimiter = "://" ;
18
18
19
19
/// <summary>
@@ -103,7 +103,7 @@ public static void FromAbsolute(
103
103
path = new PathString ( ) ;
104
104
query = new QueryString ( ) ;
105
105
fragment = new FragmentString ( ) ;
106
- var startIndex = uri . IndexOf ( SchemeDelimiter ) ;
106
+ var startIndex = uri . IndexOf ( SchemeDelimiter , StringComparison . Ordinal ) ;
107
107
108
108
if ( startIndex < 0 )
109
109
{
@@ -115,10 +115,9 @@ public static void FromAbsolute(
115
115
// PERF: Calculate the end of the scheme for next IndexOf
116
116
startIndex += SchemeDelimiter . Length ;
117
117
118
- var searchIndex = - 1 ;
118
+ int searchIndex ;
119
119
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 )
122
121
{
123
122
fragment = FragmentString . FromUriComponent ( uri . Substring ( searchIndex ) ) ;
124
123
limit = searchIndex ;
You can’t perform that action at this time.
0 commit comments