Skip to content

Commit 68f6b5b

Browse files
author
ladeak
committed
Using contains and removing the length check for 16 chars before the contains call
1 parent ce917f4 commit 68f6b5b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/Shared/QueryStringEnumerable.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,8 @@ public ReadOnlyMemory<char> DecodeValue()
9191

9292
private static ReadOnlyMemory<char> Decode(ReadOnlyMemory<char> chars)
9393
{
94-
// If the value is short, it's cheap to check up front if it really needs decoding. If it doesn't,
95-
// then we can save some allocations.
9694
ReadOnlySpan<char> source = chars.Span;
97-
if (source.Length < 16 && source.IndexOfAny('%', '+') < 0)
95+
if (!source.ContainsAny('%', '+'))
9896
{
9997
return chars;
10098
}

0 commit comments

Comments
 (0)