MCPcopy
hub / github.com/containerd/containerd / commonPrefixComponents

Function commonPrefixComponents

core/remotes/docker/handler.go:139–149  ·  view source on GitHub ↗
(components []string, target string)

Source from the content-addressed store, hash-verified

137}
138
139func commonPrefixComponents(components []string, target string) int {
140 targetComponents := strings.Split(target, "/")
141
142 i := 0
143 for ; i < len(components) && i < len(targetComponents); i++ {
144 if components[i] != targetComponents[i] {
145 break
146 }
147 }
148 return i
149}

Callers 2

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…