Revert "+ make copies of the []bytes returned by goleveldb"
This reverts commit cb8c1741289a0f00b30733e0d52d9d81d1199603. This commit is no longer desired. The KV store API has been changed to better address this issue. For more details, see the google group conversation thread at: https://groups.google.com/forum/#!topic/bleve/aHZ8gmihLiY
This commit is contained in:
parent
3a70401835
commit
81bef38cce
@ -59,17 +59,11 @@ func (ldi *Iterator) Current() ([]byte, []byte, bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (ldi *Iterator) Key() []byte {
|
func (ldi *Iterator) Key() []byte {
|
||||||
k := ldi.iterator.Key()
|
return ldi.iterator.Key()
|
||||||
rv := make([]byte, len(k))
|
|
||||||
copy(rv, k)
|
|
||||||
return rv
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ldi *Iterator) Value() []byte {
|
func (ldi *Iterator) Value() []byte {
|
||||||
v := ldi.iterator.Value()
|
return ldi.iterator.Value()
|
||||||
rv := make([]byte, len(v))
|
|
||||||
copy(rv, v)
|
|
||||||
return rv
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ldi *Iterator) Valid() bool {
|
func (ldi *Iterator) Valid() bool {
|
||||||
|
@ -52,9 +52,7 @@ func (ldbs *Store) get(key []byte) ([]byte, error) {
|
|||||||
if err == leveldb.ErrNotFound {
|
if err == leveldb.ErrNotFound {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
rv := make([]byte, len(b))
|
return b, err
|
||||||
copy(rv, b)
|
|
||||||
return rv, err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ldbs *Store) getWithSnapshot(key []byte, snapshot *leveldb.Snapshot) ([]byte, error) {
|
func (ldbs *Store) getWithSnapshot(key []byte, snapshot *leveldb.Snapshot) ([]byte, error) {
|
||||||
@ -63,9 +61,7 @@ func (ldbs *Store) getWithSnapshot(key []byte, snapshot *leveldb.Snapshot) ([]by
|
|||||||
if err == leveldb.ErrNotFound {
|
if err == leveldb.ErrNotFound {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
rv := make([]byte, len(b))
|
return b, err
|
||||||
copy(rv, b)
|
|
||||||
return rv, err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ldbs *Store) set(key, val []byte) error {
|
func (ldbs *Store) set(key, val []byte) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user