filtering code cleanup

This commit is contained in:
boyska 2018-12-26 01:54:30 +01:00
parent 658a4bbb1e
commit 5db7e2f01b

View file

@ -48,12 +48,9 @@ func (e *ExprValue) Validate(line map[string]interface{}) bool {
if !ok || val == nil { // errors when evaluating if !ok || val == nil { // errors when evaluating
return false return false
} }
if val.Type() != value.BoolType { if bv, isBool := val.(value.BoolValue); isBool {
fmt.Fprintln(os.Stderr, "WARNING: The 'where' expression doesn't return a boolean") return bv.Val()
return false
} }
if val.Value().(bool) != true { fmt.Fprintln(os.Stderr, "WARNING: The 'where' expression doesn't return a boolean")
return false return false
}
return true
} }