Keep reference algorithms in tests
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user