Fix unexpected delete bucket error

pull/209/head
Denis Dyakov 2020-03-13 23:40:49 +06:00
parent da442c51f1
commit c41b6f7c53
1 changed files with 1 additions and 1 deletions

View File

@ -228,7 +228,7 @@ func (b *Bucket) DeleteBucket(key []byte) error {
// Recursively delete all child buckets.
child := b.Bucket(key)
err := child.ForEach(func(k, v []byte) error {
if v == nil {
if _, _, childFlags := child.Cursor().seek(k); (childFlags & bucketLeafFlag) != 0 {
if err := child.DeleteBucket(k); err != nil {
return fmt.Errorf("delete bucket: %s", err)
}