Skip to content

Commit c8c8801

Browse files
committed
Revert one optimization
Subtle bug in that the entire string is being placed in the set, not the span.
1 parent 677d59d commit c8c8801

File tree

1 file changed

+1
-1
lines changed
  • src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/String

1 file changed

+1
-1
lines changed

src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/String/KeyAnalyzer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private static AnalysisResults CreateAnalysisResults(
109109
foreach (string s in uniqueStrings)
110110
{
111111
// Get the span for the substring.
112-
ReadOnlySpan<char> substring = s.AsSpan();
112+
ReadOnlySpan<char> substring = count == 0 ? s.AsSpan() : Slicer(s, index, count);
113113

114114
// If the substring isn't ASCII, bail out to return the results.
115115
if (!IsAllAscii(substring))

0 commit comments

Comments
 (0)