1 write to Chars
System.Text.RegularExpressions.Generator (1)
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (1)
569result.Chars = scratch.Slice(0, count).ToArray();
21 references to Chars
System.Text.RegularExpressions.Generator (21)
RegexGenerator.Emitter.cs (13)
1185if (primarySet.Chars is not null) 1187Debug.Assert(primarySet.Chars.Length > 0); 1196indexOf = primarySet.Chars.Length switch 11991 => $"{span}.{indexOfName}({Literal(primarySet.Chars[0])})", 12002 => $"{span}.{indexOfAnyName}({Literal(primarySet.Chars[0])}, {Literal(primarySet.Chars[1])})", 12013 => $"{span}.{indexOfAnyName}({Literal(primarySet.Chars[0])}, {Literal(primarySet.Chars[1])}, {Literal(primarySet.Chars[2])})", 12054 or 5 => $"{span}.{indexOfAnyName}({EmitSearchValuesOrLiteral(primarySet.Chars, requiredHelpers)})", 1208_ => $"{span}.{indexOfAnyName}({EmitSearchValues(primarySet.Chars, requiredHelpers)})", 1334if (set.Chars is { Length: 1 }) 1337writer.WriteLine($"pos = inputSpan.Slice(0, pos).LastIndexOf({Literal(set.Chars[0])});");
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (5)
233(fixedDistanceSets[0].Chars is not null && !fixedDistanceSets[0].Negated)) 240fixedDistanceSets[0].Chars is { Length: 1 } && 243FixedDistanceLiteral = (fixedDistanceSets[0].Chars![0], null, fixedDistanceSets[0].Distance); 331/// <summary>As an alternative to <see cref="Chars"/>, a description of the single range the set represents, if it does.</summary> 356char[]? chars = i < fixedDistanceSets.Count ? fixedDistanceSets[i].Chars : null;
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (3)
522!r.Negated && r.Chars is null && r.Range is null, 793char[]? s1Chars = s1.Chars; 794char[]? s2Chars = s2.Chars;