update sift to match docstring (#245)
continuous-integration/drone/push Build is passing Details

Closes #244.

Reviewed-on: #245
Reviewed-by: James Mills <james@mills.io>
Co-authored-by: Tai Groot <tai@taigrr.com>
Co-committed-by: Tai Groot <tai@taigrr.com>
master
Tai Groot 1 year ago committed by James Mills
parent d23c355e72
commit edd32cad0a

@ -264,7 +264,9 @@ func (b *Bitcask) Sift(f func(key []byte) (bool, error)) (err error) {
return true
})
b.mu.RUnlock()
if err != nil {
return
}
b.mu.Lock()
defer b.mu.Unlock()
keysToDelete.ForEach(func(node art.Node) (cont bool) {
@ -343,6 +345,10 @@ func (b *Bitcask) SiftScan(prefix []byte, f func(key []byte) (bool, error)) (err
})
b.mu.RUnlock()
if err != nil {
return
}
b.mu.Lock()
defer b.mu.Unlock()
keysToDelete.ForEach(func(node art.Node) (cont bool) {
@ -422,6 +428,10 @@ func (b *Bitcask) SiftRange(start, end []byte, f func(key []byte) (bool, error))
})
b.mu.RUnlock()
if err != nil {
return
}
b.mu.Lock()
defer b.mu.Unlock()

Loading…
Cancel
Save