@@ -672,9 +672,12 @@ func (db *DB) Put(dst, key []byte, upd func(key, old []byte) (new []byte, write
672
672
return
673
673
}
674
674
675
- // Seek returns an enumerator with "position" or an error if any. Normally the
676
- // position is on a KV pair such that key >= KV.key. Then hit is key == KV.key.
677
- // The position is possibly "after" the last KV pair, but that is not an error.
675
+ // Seek returns an enumerator or an error if any. Normally the enumerator is
676
+ // positioned on a KV pair such that 'key' >= KV.key and 'hit' is key ==
677
+ // KV.key. If 'key' collates after any existing key in the DB then the
678
+ // enumerator's position is effectively "after" the last KV pair, but that is
679
+ // not an error. However, such enumerator will return err set to io.EOF from
680
+ // its Next/Prev methods.
678
681
//
679
682
// Seek is atomic and it is safe for concurrent use by multiple goroutines.
680
683
func (db * DB ) Seek (key []byte ) (enum * Enumerator , hit bool , err error ) {
@@ -697,7 +700,7 @@ func (db *DB) Seek(key []byte) (enum *Enumerator, hit bool, err error) {
697
700
}
698
701
699
702
// SeekFirst returns an enumerator positioned on the first KV pair in the DB,
700
- // if any. For an empty DB, err == io.EOF is returend .
703
+ // if any. For an empty DB, err == io.EOF is returned .
701
704
//
702
705
// SeekFirst is atomic and it is safe for concurrent use by multiple
703
706
// goroutines.
@@ -721,7 +724,7 @@ func (db *DB) SeekFirst() (enum *Enumerator, err error) {
721
724
}
722
725
723
726
// SeekLast returns an enumerator positioned on the last KV pair in the DB,
724
- // if any. For an empty DB, err == io.EOF is returend .
727
+ // if any. For an empty DB, err == io.EOF is returned .
725
728
//
726
729
// SeekLast is atomic and it is safe for concurrent use by multiple
727
730
// goroutines.
@@ -763,7 +766,7 @@ func (db *DB) Set(key, value []byte) (err error) {
763
766
// enumerator is aware of any mutations made to the tree in the process of
764
767
// enumerating it and automatically resumes the enumeration.
765
768
//
766
- // Multiple consurrently executing enumerations may be in progress.
769
+ // Multiple concurrently executing enumerations may be in progress.
767
770
type Enumerator struct {
768
771
db * DB
769
772
enum * lldb.BTreeEnumerator
0 commit comments