Browse Source

Add comments about copying

pull/1842/head
Alexis Sellier 7 years ago
parent
commit
6b1e3bcee3
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      db/go_level_db.go

+ 2
- 0
db/go_level_db.go View File

@ -121,6 +121,7 @@ type goLevelDBIterator struct {
iterator.Iterator iterator.Iterator
} }
// Key returns a copy of the current key.
func (it *goLevelDBIterator) Key() []byte { func (it *goLevelDBIterator) Key() []byte {
key := it.Key() key := it.Key()
k := make([]byte, len(key)) k := make([]byte, len(key))
@ -129,6 +130,7 @@ func (it *goLevelDBIterator) Key() []byte {
return k return k
} }
// Value returns a copy of the current value.
func (it *goLevelDBIterator) Value() []byte { func (it *goLevelDBIterator) Value() []byte {
val := it.Value() val := it.Value()
v := make([]byte, len(val)) v := make([]byte, len(val))


Loading…
Cancel
Save