Add comments about copying

This commit is contained in:
Alexis Sellier 2017-10-13 13:03:43 +02:00
parent e9e6ec3a2c
commit 6b1e3bcee3
1 changed files with 2 additions and 0 deletions

View File

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