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

Method Valid

iterator.go:519–527  ·  view source on GitHub ↗

Valid returns false when iteration is done.

()

Source from the content-addressed store, hash-verified

517
518// Valid returns false when iteration is done.
519func (it *Iterator) Valid() bool {
520 if it.item == nil {
521 return false
522 }
523 if it.opt.prefixIsKey {
524 return bytes.Equal(it.item.key, it.opt.Prefix)
525 }
526 return bytes.HasPrefix(it.item.key, it.opt.Prefix)
527}
528
529// ValidForPrefix returns false when iteration is done
530// or when the current key is not prefixed by the specified prefix.

Callers 1

ValidForPrefixMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected