LevelDB backend: Recycle iterator in all keys fetch.

This commit is contained in:
Sascha L. Teichmann 2014-08-11 17:07:23 +02:00
parent ecf00b45f5
commit 120531ed78
1 changed files with 0 additions and 2 deletions

View File

@ -169,7 +169,6 @@ func (ldbs *LevelDBSession) AllKeys(hash []byte) (keys chan []byte, n int, err e
ldbs.backend.mutex.RUnlock()
return
}
it.Close()
keys = make(chan []byte)
@ -177,7 +176,6 @@ func (ldbs *LevelDBSession) AllKeys(hash []byte) (keys chan []byte, n int, err e
ldbs.backend.mutex.RUnlock()
defer ro.Close()
defer close(keys)
it := ldbs.backend.db.NewIterator(ro)
defer it.Close()
it.SeekToFirst()
for ; it.Valid(); it.Next() {