[#160] Store root and phy indexes as fake bucket tree

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-11-13 17:20:58 +03:00 committed by Alex Vanin
parent f1a3acd27a
commit ea41dec23f
2 changed files with 1 additions and 3 deletions

View file

@ -130,14 +130,12 @@ func objectIndices(obj *object.Object, parent bool) []bucketItem {
if obj.GetType() == objectSDK.TypeRegular && !obj.HasParent() { if obj.GetType() == objectSDK.TypeRegular && !obj.HasParent() {
res = append(res, bucketItem{ res = append(res, bucketItem{
key: v2object.FilterPropertyRoot, key: v2object.FilterPropertyRoot,
val: v2object.BooleanPropertyValueTrue,
}) })
} }
if !parent { if !parent {
res = append(res, bucketItem{ res = append(res, bucketItem{
key: v2object.FilterPropertyPhy, key: v2object.FilterPropertyPhy,
val: v2object.BooleanPropertyValueTrue,
}) })
} }

View file

@ -116,7 +116,7 @@ func (db *DB) selectAll(tx *bbolt.Tx) ([]*object.Address, error) {
rootBucket := indexBucket.Bucket([]byte(v2object.FilterPropertyRoot)) rootBucket := indexBucket.Bucket([]byte(v2object.FilterPropertyRoot))
if rootBucket != nil { if rootBucket != nil {
rootBucket = rootBucket.Bucket(nonEmptyKeyBytes([]byte(v2object.BooleanPropertyValueTrue))) rootBucket = rootBucket.Bucket(nonEmptyKeyBytes(nil))
} }
if rootBucket != nil { if rootBucket != nil {