Skip to content

Commit

Permalink
Stop looping on eq failure
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSisley committed Jun 28, 2022
1 parent 61a2065 commit c539992
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions connor/eq.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,16 @@ func eq(condition, data interface{}) (bool, error) {
case map[FilterKey]interface{}:
m := true
for prop, cond := range cn {
if !m {
// No need to evaluate after we fail
continue
}

mm, err := matchWith(prop.GetOperatorOrDefault("_eq"), cond, prop.GetProp(data))
var err error
m, err = matchWith(prop.GetOperatorOrDefault("_eq"), cond, prop.GetProp(data))
if err != nil {
return false, err
}

m = m && mm
if !m {
// No need to evaluate after we fail
break
}
}

return m, nil
Expand Down

0 comments on commit c539992

Please sign in to comment.