forked from TrueCloudLab/frostfs-node
[#1] metabase: Rename blindlyProcess()
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
73a71a71b0
commit
cab51c8cbe
1 changed files with 3 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue