24 references to Distance
System.Text.RegularExpressions.Generator (24)
parent\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (7)
243
FixedDistanceLiteral = (fixedDistanceSets[0].Chars![0], null, fixedDistanceSets[0].
Distance
);
258
FindMode = (fixedDistanceSets.Count == 1 && fixedDistanceSets[0].
Distance
== 0) ?
347
fixedDistanceSets.Sort((s1, s2) => s1.
Distance
.CompareTo(s2.
Distance
));
364
(i > 0 && fixedDistanceSets[i].
Distance
!= fixedDistanceSets[i - 1].
Distance
+ 1))
368
best = (vsb.ToString(), fixedDistanceSets[start].
Distance
);
parent\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (5)
742
if (combined.TryGetValue(fixedSet.
Distance
, out (RegexCharClass Set, int Count) value))
747
combined[fixedSet.
Distance
] = value;
752
combined[fixedSet.
Distance
] = (RegexCharClass.Parse(fixedSet.Set), 1);
886
return s1.
Distance
.CompareTo(s2.
Distance
);
RegexGenerator.Emitter.cs (12)
1285
writer.WriteLine(primarySet.
Distance
== 0 ?
1287
$"// The pattern matches {DescribeSet(primarySet.Set)} at index {primarySet.
Distance
}.");
1305
string upperBound = "span.Length" + (setsToUse > 1 || primarySet.
Distance
!= 0 ? $" - {minRequiredLength - 1}" : "");
1315
span = (needLoop, primarySet.
Distance
) switch
1319
(false, _) => $"{span}.Slice({primarySet.
Distance
})",
1320
(true, _) => $"{span}.Slice(i + {primarySet.
Distance
})",
1390
int maxDistance = sets[1].
Distance
;
1393
maxDistance = Math.Max(maxDistance, sets[i].
Distance
);
1395
if (maxDistance > primarySet.
Distance
)
1435
string spanIndex = $"span[i{(sets[setIndex].
Distance
> 0 ? $" + {sets[setIndex].
Distance
}" : "")}]";
1469
Debug.Assert(set.
Distance
== 0);