From 458400eb82872bd909c69967f094c3ebbdf0d3d9 Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Sun, 4 May 2014 18:30:30 -0700 Subject: Cursor.Seek validity is indicated by key being nil --- cursor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cursor.go b/cursor.go index 520edd4..6e70bc5 100644 --- a/cursor.go +++ b/cursor.go @@ -112,7 +112,7 @@ func (c *Cursor) Prev() (key []byte, value []byte) { // Seek moves the cursor to a given key and returns it. // If the key does not exist then the next key is used. If no keys -// follow, a nil value is returned. +// follow, a nil key is returned. func (c *Cursor) Seek(seek []byte) (key []byte, value []byte) { k, v, flags := c.seek(seek) if k == nil { -- cgit v1.2.3 From eaa47b6468543e42ed08aefab5bf83efa9ad9980 Mon Sep 17 00:00:00 2001 From: Tommi Virtanen Date: Sun, 4 May 2014 18:32:59 -0700 Subject: Document cursors seeing nested buckets --- cursor.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cursor.go b/cursor.go index 6e70bc5..56948fc 100644 --- a/cursor.go +++ b/cursor.go @@ -6,6 +6,7 @@ import ( ) // Cursor represents an iterator that can traverse over all key/value pairs in a bucket in sorted order. +// Cursors see nested buckets with value == nil. // Cursors can be obtained from a transaction and are valid as long as the transaction is open. type Cursor struct { bucket *Bucket -- cgit v1.2.3