MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / skipToNext

Method skipToNext

engine/iterator.go:64–78  ·  view source on GitHub ↗

According to the key passed by Prefix, the key is equal to the key prefix in the iterator. If it is not equal, the next iteration is performed

()

Source from the content-addressed store, hash-verified

62// the key is equal to the key prefix in the iterator.
63// If it is not equal, the next iteration is performed
64func (it *Iterator) skipToNext() {
65 prefixLen := len(it.options.Prefix)
66 if prefixLen == 0 {
67 return
68 }
69
70 for ; it.indexIter.Valid(); it.indexIter.Next() {
71 key := it.indexIter.Key()
72
73 // Check if the key has the desired prefix
74 if prefixLen <= len(key) && bytes.Equal(it.options.Prefix, key[:prefixLen]) {
75 break
76 }
77 }
78}

Callers 3

RewindMethod · 0.95
SeekMethod · 0.95
NextMethod · 0.95

Calls 3

ValidMethod · 0.65
NextMethod · 0.65
KeyMethod · 0.65

Tested by

no test coverage detected