forked from TrueCloudLab/frostfs-node
[#99] Fix no-root search matcher
Wrong boolean operation order made matcher return false on `non-root` search query with non-regular objects. Instead it should return true for `non-root` query and false for `root` query. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
d4461b9493
commit
719075ca97
1 changed files with 2 additions and 2 deletions
|
@ -45,8 +45,8 @@ func (q *Query) Match(obj *object.Object, handler func(*objectSDK.ID)) {
|
|||
default:
|
||||
match = headerEqual(obj, key, q.filters[i].Value())
|
||||
case objectSDK.KeyRoot:
|
||||
match = (q.filters[i].Value() == objectSDK.ValRoot) == !obj.HasParent() &&
|
||||
obj.GetType() == objectSDK.TypeRegular
|
||||
match = (q.filters[i].Value() == objectSDK.ValRoot) == (!obj.HasParent() &&
|
||||
obj.GetType() == objectSDK.TypeRegular)
|
||||
case objectSDK.KeyLeaf:
|
||||
match = (q.filters[i].Value() == objectSDK.ValLeaf) == (par == nil)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue