forked from mirror/ledisdb
bug fix set close iterator
This commit is contained in:
parent
a1555c6096
commit
f094ed65e3
|
@ -374,6 +374,8 @@ func (db *DB) SMembers(key []byte) ([][]byte, error) {
|
||||||
v := make([][]byte, 0, 16)
|
v := make([][]byte, 0, 16)
|
||||||
|
|
||||||
it := db.bucket.RangeLimitIterator(start, stop, store.RangeROpen, 0, -1)
|
it := db.bucket.RangeLimitIterator(start, stop, store.RangeROpen, 0, -1)
|
||||||
|
defer it.Close()
|
||||||
|
|
||||||
for ; it.Valid(); it.Next() {
|
for ; it.Valid(); it.Next() {
|
||||||
_, m, err := db.sDecodeSetKey(it.Key())
|
_, m, err := db.sDecodeSetKey(it.Key())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -383,8 +385,6 @@ func (db *DB) SMembers(key []byte) ([][]byte, error) {
|
||||||
v = append(v, m)
|
v = append(v, m)
|
||||||
}
|
}
|
||||||
|
|
||||||
it.Close()
|
|
||||||
|
|
||||||
return v, nil
|
return v, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue