MCPcopy
hub / github.com/lindb/lindb / Valid

Method Valid

pkg/trie/iterator.go:317–327  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

315}
316
317func (itr *PrefixIterator) Valid() bool {
318 if len(itr.prefix) == 0 {
319 return itr.it.Valid()
320 }
321 if !itr.it.Valid() {
322 return false
323 }
324 // buffer key
325 itr.key = itr.it.Key()
326 return bytes.HasPrefix(itr.key, itr.prefix)
327}
328
329func (itr *PrefixIterator) Next() {
330 itr.key = nil

Callers 5

TestPrefixIteratorFunction · 0.95
WriteMethod · 0.95
CollectKVsMethod · 0.95
FindValuesByRegexpMethod · 0.95
FindValuesByLikeMethod · 0.95

Calls 2

KeyMethod · 0.65
ValidMethod · 0.45

Tested by 1

TestPrefixIteratorFunction · 0.76