MCPcopy Index your code
hub / github.com/nutsdb/nutsdb / Next

Method Next

iterator.go:91–109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

89}
90
91func (it *Iterator) Next() bool {
92 if !it.valid {
93 return false
94 }
95
96 if it.options.Reverse {
97 it.valid = it.iter.Prev()
98 } else {
99 it.valid = it.iter.Next()
100 }
101
102 if it.valid {
103 it.currentItem = it.iter.Item()
104 } else {
105 it.currentItem = nil
106 }
107
108 return it.valid
109}
110
111func (it *Iterator) Valid() bool {
112 return it.valid

Callers 15

BenchmarkIterator_NextFunction · 0.95
BenchmarkIterator_PrevFunction · 0.95
BenchmarkIterator_RewindFunction · 0.95
TestIteratorFunction · 0.95
TestIterator_ReverseFunction · 0.95
TestIterator_ItemFunction · 0.95
TestIterator_RewindFunction · 0.95

Calls 1

ItemMethod · 0.80

Tested by 15

BenchmarkIterator_NextFunction · 0.76
BenchmarkIterator_PrevFunction · 0.76
BenchmarkIterator_RewindFunction · 0.76
TestIteratorFunction · 0.76
TestIterator_ReverseFunction · 0.76
TestIterator_ItemFunction · 0.76
TestIterator_RewindFunction · 0.76