Compare canonical paths by token spelling
This commit is contained in:
@@ -337,12 +337,12 @@ func pathContains(container, descendant Path) bool {
|
||||
if !container.valid() || !descendant.valid() || len(container.segments) > len(descendant.segments) {
|
||||
return false
|
||||
}
|
||||
if container.String() == "" {
|
||||
return true
|
||||
for i, segment := range container.segments {
|
||||
if !pathTokenSpellingEqual(segment, descendant.segments[i]) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
prefix := container.String()
|
||||
value := descendant.String()
|
||||
return value == prefix || strings.HasPrefix(value, prefix+"/")
|
||||
return true
|
||||
}
|
||||
|
||||
func appendUniqueString(values []string, value string) []string {
|
||||
@@ -354,7 +354,7 @@ func appendUniqueString(values []string, value string) []string {
|
||||
|
||||
func appendUniquePath(paths []Path, path Path) []Path {
|
||||
for _, existing := range paths {
|
||||
if existing.String() == path.String() {
|
||||
if pathSpellingEqual(existing, path) {
|
||||
return paths
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user