MCPcopy
hub / github.com/etcd-io/bbolt / Next

Method Next

cursor.go:95–102  ·  cursor.go::Cursor.Next

Next moves the cursor to the next item in the bucket and returns its key and value. If the cursor is at the end of the bucket then a nil key and value are returned. The returned key and value are only valid for the life of the transaction.

()

Source from the content-addressed store, hash-verified

93// If the cursor is at the end of the bucket then a nil key and value are returned.
94// The returned key and value are only valid for the life of the transaction.
95func (c *Cursor) Next() (key []byte, value []byte) {
96 common.Assert(c.bucket.tx.db != nil, "tx closed")
97 k, v, flags := c.next()
98 if (flags & uint32(common.BucketLeafFlag)) != 0 {
99 return k, nil
100 }
101 return k, v
102}
103
104// Prev moves the cursor to the previous item in the bucket and returns its key and value.
105// If the cursor is at the beginning of the bucket then a nil key and value are returned.

Callers 15

TestCursor_DeleteFunction · 0.80
TestCursor_Iterate_LeafFunction · 0.80
TestCursor_RestartFunction · 0.80
TestCursor_QuickCheckFunction · 0.80
ExampleCursorFunction · 0.80
ExampleDB_BeginFunction · 0.80
validateBatchBenchFunction · 0.80

Calls 2

nextMethod · 0.95
AssertFunction · 0.92

Tested by 14

TestCursor_DeleteFunction · 0.64
TestCursor_Iterate_LeafFunction · 0.64
TestCursor_RestartFunction · 0.64
TestCursor_QuickCheckFunction · 0.64
ExampleCursorFunction · 0.64
ExampleDB_BeginFunction · 0.64
validateBatchBenchFunction · 0.64