Skip to content

Commit

Permalink
Avoid use of string.IndexOf(char) to prevent erroneous build errors a…
Browse files Browse the repository at this point in the history
…bout using IndexOf(char, StringComparison) that doesn't exist
  • Loading branch information
jstedfast committed May 24, 2023
1 parent 6aa0ade commit 836612c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Essentials/src/Types/Shared/WebUtils.shared.cs
Expand Up @@ -5,8 +5,6 @@ namespace Microsoft.Maui.ApplicationModel
{
static class WebUtils
{
private static readonly char[] QuestionMarkOrAmpersand = new char[] { '?', '&' };

internal static IDictionary<string, string> ParseQueryString(string url)
{
var parameters = new Dictionary<string, string>(StringComparer.Ordinal);
Expand Down Expand Up @@ -36,8 +34,8 @@ static class WebUtils
{
int nameIndex = index;

if ((index = url.IndexOfAny(QuestionMarkOrAmpersand, index)) < 0)
index = url.Length;
while (index < url.Length && url[index] != '=' && url[index] != '&')
index++;

int nameLength = index - nameIndex;

Expand Down

0 comments on commit 836612c

Please sign in to comment.