From cab51c8cbe959739b7808a6c797ff0f04b45ff56 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Mon, 26 Jun 2023 14:49:08 +0300 Subject: [PATCH] [#1] metabase: Rename blindlyProcess() Signed-off-by: Evgenii Stratonikov --- pkg/local_object_storage/metabase/select.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/local_object_storage/metabase/select.go b/pkg/local_object_storage/metabase/select.go index 0f53a8f36..998ce9b94 100644 --- a/pkg/local_object_storage/metabase/select.go +++ b/pkg/local_object_storage/metabase/select.go @@ -84,7 +84,7 @@ func (db *DB) Select(ctx context.Context, prm SelectPrm) (res SelectRes, err err return res, ErrDegradedMode } - if blindlyProcess(prm.filters) { + if checkNonEmpty(prm.filters) { success = true return res, nil } @@ -556,15 +556,12 @@ func markAddressInCache(cache map[string]int, fNum int, addr string) { } } -// returns true if query leads to a deliberately empty result. -func blindlyProcess(fs object.SearchFilters) bool { +// Returns true if at least 1 object can satisfy fs. +func checkNonEmpty(fs object.SearchFilters) bool { for i := range fs { if fs[i].Operation() == object.MatchNotPresent && isSystemKey(fs[i].Header()) { return true } - - // TODO: #1148 check other cases - // e.g. (a == b) && (a != b) } return false