24 references to Distance
System.Text.RegularExpressions.Generator (24)
parent\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);
parent\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (5)
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);
RegexGenerator.Emitter.cs (12)
1285writer.WriteLine(primarySet.Distance == 0 ? 1287$"// The pattern matches {DescribeSet(primarySet.Set)} at index {primarySet.Distance}."); 1305string upperBound = "span.Length" + (setsToUse > 1 || primarySet.Distance != 0 ? $" - {minRequiredLength - 1}" : ""); 1315span = (needLoop, primarySet.Distance) switch 1319(false, _) => $"{span}.Slice({primarySet.Distance})", 1320(true, _) => $"{span}.Slice(i + {primarySet.Distance})", 1390int maxDistance = sets[1].Distance; 1393maxDistance = Math.Max(maxDistance, sets[i].Distance); 1395if (maxDistance > primarySet.Distance) 1435string spanIndex = $"span[i{(sets[setIndex].Distance > 0 ? $" + {sets[setIndex].Distance}" : "")}]"; 1469Debug.Assert(set.Distance == 0);