[#1944] metabase: Recreate static buckets instead of resetting
From the `Bucket.ForEach` doc: ``` The provided function must not modify the bucket; this will result in undefined behavior. ``` Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
parent
3c6daa2995
commit
e4bc3d0e9d
2 changed files with 9 additions and 18 deletions
|
@ -223,17 +223,6 @@ func objectKey(obj oid.ID, key []byte) []byte {
|
|||
return key[:objectKeySize]
|
||||
}
|
||||
|
||||
// removes all bucket elements.
|
||||
func resetBucket(b *bbolt.Bucket) error {
|
||||
return b.ForEach(func(k, v []byte) error {
|
||||
if v != nil {
|
||||
return b.Delete(k)
|
||||
}
|
||||
|
||||
return b.DeleteBucket(k)
|
||||
})
|
||||
}
|
||||
|
||||
// if meets irregular object container in objs - returns its type, otherwise returns object.TypeRegular.
|
||||
//
|
||||
// firstIrregularObjectType(tx, cnr, obj) usage allows getting object type.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue