MCPcopy Index your code
hub / github.com/perkeep/perkeep / queryPrefixString

Function queryPrefixString

pkg/index/index.go:621–631  ·  view source on GitHub ↗
(s sorted.KeyValue, prefix string)

Source from the content-addressed store, hash-verified

619}
620
621func queryPrefixString(s sorted.KeyValue, prefix string) sorted.Iterator {
622 if prefix == "" {
623 return s.Find("", "")
624 }
625 lastByte := prefix[len(prefix)-1]
626 if lastByte == 0xff {
627 panic("unsupported query prefix ending in 0xff")
628 }
629 end := prefix[:len(prefix)-1] + string(lastByte+1)
630 return s.Find(prefix, end)
631}
632
633func (x *Index) queryPrefixString(prefix string) sorted.Iterator {
634 return queryPrefixString(x.s, prefix)

Callers 4

queryPrefixStringMethod · 0.85
queryPrefixFunction · 0.85
enumerateBlobMetaFunction · 0.85
scanPrefixMethod · 0.85

Calls 1

FindMethod · 0.65

Tested by

no test coverage detected