1
0
mirror of https://github.com/taigrr/bitcask synced 2025-01-18 04:03:17 -08:00

update sift to match docstring

This commit is contained in:
Tai Groot 2022-02-04 02:01:27 -08:00
parent d23c355e72
commit a72a4d0494
Signed by: taigrr
GPG Key ID: D00C269A87614812

View File

@ -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()