Skip to content

Commit

Permalink
Change isNotIn
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Snider <jsnider@mtu.edu>
  • Loading branch information
jsnider-mtu committed Mar 16, 2021
1 parent ff4fb41 commit 9377f70
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/engine/variables/operator/in.go
Expand Up @@ -180,7 +180,7 @@ func isIn(key []string, value []string) bool {
return true
}

// isNotIn checks if none of the values in S1 is in S2
// isNotIn checks if any of the values in S1 is not in S2
func isNotIn(key []string, value []string) bool {
set := make(map[string]bool)

Expand All @@ -190,12 +190,12 @@ func isNotIn(key []string, value []string) bool {

for _, val := range key {
_, found := set[val]
if found {
return false
if !found {
return true
}
}

return true
return false
}

func (in InHandler) validateValueWithBoolPattern(_ bool, _ interface{}) bool {
Expand Down

0 comments on commit 9377f70

Please sign in to comment.