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

Method Rewind

iterator.go:63–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61}
62
63func (it *Iterator) Rewind() bool {
64 if it.options.Reverse {
65 it.valid = it.iter.Last()
66 } else {
67 it.valid = it.iter.First()
68 }
69
70 if it.valid {
71 it.currentItem = it.iter.Item()
72 } else {
73 it.currentItem = nil
74 }
75
76 return it.valid
77}
78
79func (it *Iterator) Seek(key []byte) bool {
80 it.valid = it.iter.Seek(&core.Item[core.Record]{Key: key})

Callers 3

BenchmarkIterator_RewindFunction · 0.95
TestIterator_RewindFunction · 0.95

Calls 2

ItemMethod · 0.80
FirstMethod · 0.65

Tested by 3

BenchmarkIterator_RewindFunction · 0.76
TestIterator_RewindFunction · 0.76