mirror of https://github.com/ledisdb/ledisdb.git
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)
|
||||
|
||||
it := db.bucket.RangeLimitIterator(start, stop, store.RangeROpen, 0, -1)
|
||||
defer it.Close()
|
||||
|
||||
for ; it.Valid(); it.Next() {
|
||||
_, m, err := db.sDecodeSetKey(it.Key())
|
||||
if err != nil {
|
||||
|
@ -383,8 +385,6 @@ func (db *DB) SMembers(key []byte) ([][]byte, error) {
|
|||
v = append(v, m)
|
||||
}
|
||||
|
||||
it.Close()
|
||||
|
||||
return v, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue