1 write to Chars
System.Text.RegularExpressions.Generator (1)
parent\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (1)
569result.Chars = scratch.Slice(0, count).ToArray();
20 references to Chars
System.Text.RegularExpressions.Generator (20)
parent\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); 356char[]? chars = i < fixedDistanceSets.Count ? fixedDistanceSets[i].Chars : null; 888if (set.Chars is not { Length: > 1 } chars)
parent\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (2)
793char[]? s1Chars = s1.Chars; 794char[]? s2Chars = s2.Chars;
RegexGenerator.Emitter.cs (13)
1325if (primarySet.Chars is not null) 1327Debug.Assert(primarySet.Chars.Length > 0); 1336indexOf = primarySet.Chars.Length switch 13391 => $"{span}.{indexOfName}({Literal(primarySet.Chars[0])})", 13402 => $"{span}.{indexOfAnyName}({Literal(primarySet.Chars[0])}, {Literal(primarySet.Chars[1])})", 13413 => $"{span}.{indexOfAnyName}({Literal(primarySet.Chars[0])}, {Literal(primarySet.Chars[1])}, {Literal(primarySet.Chars[2])})", 13454 or 5 => $"{span}.{indexOfAnyName}({EmitSearchValuesOrLiteral(primarySet.Chars, requiredHelpers)})", 1348_ => $"{span}.{indexOfAnyName}({EmitSearchValues(primarySet.Chars, requiredHelpers)})", 1474if (set.Chars is { Length: 1 }) 1477writer.WriteLine($"pos = inputSpan.Slice(0, pos).LastIndexOf({Literal(set.Chars[0])});");