[#61] object/search: Support non-root and non-leaf filters
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
51e373c3f0
commit
6824a6f67b
1 changed files with 2 additions and 2 deletions
|
@ -45,9 +45,9 @@ func (q *Query) Match(obj *object.Object, handler func(*objectSDK.ID)) {
|
||||||
default:
|
default:
|
||||||
match = headerEqual(obj, key, q.filters[i].Value())
|
match = headerEqual(obj, key, q.filters[i].Value())
|
||||||
case objectSDK.KeyRoot:
|
case objectSDK.KeyRoot:
|
||||||
match = !obj.HasParent()
|
match = (q.filters[i].Value() == objectSDK.ValRoot) == !obj.HasParent()
|
||||||
case objectSDK.KeyLeaf:
|
case objectSDK.KeyLeaf:
|
||||||
match = par == nil
|
match = (q.filters[i].Value() == objectSDK.ValLeaf) == (par == nil)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue