25 references to Distance
System.Text.RegularExpressions.Generator (25)
RegexGenerator.Emitter.cs (12)
1145writer.WriteLine(primarySet.Distance == 0 ? 1147$"// The pattern matches {DescribeSet(primarySet.Set)} at index {primarySet.Distance}."); 1165string upperBound = "span.Length" + (setsToUse > 1 || primarySet.Distance != 0 ? $" - {minRequiredLength - 1}" : ""); 1175span = (needLoop, primarySet.Distance) switch 1179(false, _) => $"{span}.Slice({primarySet.Distance})", 1180(true, _) => $"{span}.Slice(i + {primarySet.Distance})", 1250int maxDistance = sets[1].Distance; 1253maxDistance = Math.Max(maxDistance, sets[i].Distance); 1255if (maxDistance > primarySet.Distance) 1295string spanIndex = $"span[i{(sets[setIndex].Distance > 0 ? $" + {sets[setIndex].Distance}" : "")}]"; 1329Debug.Assert(set.Distance == 0);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (7)
243FixedDistanceLiteral = (fixedDistanceSets[0].Chars![0], null, fixedDistanceSets[0].Distance); 258FindMode = (fixedDistanceSets.Count == 1 && fixedDistanceSets[0].Distance == 0) ? 347fixedDistanceSets.Sort((s1, s2) => s1.Distance.CompareTo(s2.Distance)); 364(i > 0 && fixedDistanceSets[i].Distance != fixedDistanceSets[i - 1].Distance + 1)) 368best = (vsb.ToString(), fixedDistanceSets[start].Distance);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (6)
523$"{nameof(TryFindRawFixedSets)} should have only populated {nameof(r.Set)} and {nameof(r.Distance)}")); 742if (combined.TryGetValue(fixedSet.Distance, out (RegexCharClass Set, int Count) value)) 747combined[fixedSet.Distance] = value; 752combined[fixedSet.Distance] = (RegexCharClass.Parse(fixedSet.Set), 1); 886return s1.Distance.CompareTo(s2.Distance);