bug fix set close iterator

This commit is contained in:
siddontang 2014-11-27 09:20:49 +08:00
parent a1555c6096
commit f094ed65e3
1 changed files with 2 additions and 2 deletions

View File

@ -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
}