MCPcopy Create free account
hub / github.com/couchbase/moss / sharedPrefixLen

Function sharedPrefixLen

iterator.go:489–498  ·  view source on GitHub ↗

-------------------------------------------- sharedPrefixLen returns the length of the prefix shared by a and b, which can might be 0 length.

(a, b []byte)

Source from the content-addressed store, hash-verified

487// sharedPrefixLen returns the length of the prefix shared by a and b,
488// which can might be 0 length.
489func sharedPrefixLen(a, b []byte) int {
490 i := 0
491 for i < len(a) && i < len(b) {
492 if a[i] != b[i] {
493 return i
494 }
495 i++
496 }
497 return i
498}

Callers 2

TestSharedPrefixLenFunction · 0.85
startIteratorMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestSharedPrefixLenFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…