MCPcopy
hub / github.com/dgraph-io/badger / ValidForPrefix

Method ValidForPrefix

iterator.go:531–533  ·  view source on GitHub ↗

ValidForPrefix returns false when iteration is done or when the current key is not prefixed by the specified prefix.

(prefix []byte)

Source from the content-addressed store, hash-verified

529// ValidForPrefix returns false when iteration is done
530// or when the current key is not prefixed by the specified prefix.
531func (it *Iterator) ValidForPrefix(prefix []byte) bool {
532 return it.Valid() && bytes.HasPrefix(it.item.key, prefix)
533}
534
535// Close would close the iterator. It is important to call this when you're done with iteration.
536func (it *Iterator) Close() {

Callers 4

deleteMoveKeysForMethod · 0.95
TestIterateDeletedFunction · 0.95
buildHistogramMethod · 0.95

Calls 1

ValidMethod · 0.95

Tested by 2

TestIterateDeletedFunction · 0.76