aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Johnson <benbjohnson@yahoo.com>2014-05-04 21:46:50 -0600
committerBen Johnson <benbjohnson@yahoo.com>2014-05-04 21:46:50 -0600
commit84570ee67e328c5631a111ffa05110630a58533b (patch)
treed73898265bc60891ff552786652dd7e7e91d2782
parentMerge pull request #148 from benbjohnson/split-spill (diff)
parentDocument cursors seeing nested buckets (diff)
downloaddedo-84570ee67e328c5631a111ffa05110630a58533b.tar.gz
dedo-84570ee67e328c5631a111ffa05110630a58533b.tar.xz
Merge pull request #150 from tv42/typo-seek
Fix Cursor.Seek to say caller should test key==nil not value==nil, explain what value==nil really means these days
-rw-r--r--cursor.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/cursor.go b/cursor.go
index 520edd4..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
@@ -112,7 +113,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 {