Keep reference algorithms in tests

This commit is contained in:
2026-10-09 04:14:45 +00:00
parent f849e06b77
commit 53b79528d9
6 changed files with 87 additions and 100 deletions

View File

@@ -370,17 +370,6 @@ type resolutionCoverageIndex struct {
depths []int
}
func newResolutionCoverageIndex(paths []Path) *resolutionCoverageIndex {
index := &resolutionCoverageIndex{depths: make([]int, len(paths))}
for id, path := range paths {
index.depths[id] = len(path.segments)
if path.valid() {
index.prefix.insert(path.String(), id)
}
}
return index
}
func newResolutionCoverageIndexFromRecords(records []*resolutionRecord) *resolutionCoverageIndex {
index := &resolutionCoverageIndex{depths: make([]int, len(records))}
for id, record := range records {
@@ -436,22 +425,6 @@ func pathContains(container, descendant Path) bool {
return true
}
func appendUniqueString(values []string, value string) []string {
if !slices.Contains(values, value) {
return append(values, value)
}
return values
}
func appendUniquePath(paths []Path, path Path) []Path {
for _, existing := range paths {
if pathSpellingEqual(existing, path) {
return paths
}
}
return append(paths, path.clone())
}
func clonePaths(paths []Path) []Path {
if paths == nil {
return nil