eval
This commit is contained in:
@@ -3,6 +3,7 @@ package voucher
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
"unicode"
|
||||
@@ -137,12 +138,7 @@ func (rs *RuleSet) Applies(ctx EvalContext) bool {
|
||||
|
||||
// anyItem returns true if predicate matches any item.
|
||||
func anyItem(items []Item, pred func(Item) bool) bool {
|
||||
for _, it := range items {
|
||||
if pred(it) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return slices.ContainsFunc(items, pred)
|
||||
}
|
||||
|
||||
// ParseRules parses a rule expression into a RuleSet.
|
||||
|
||||
Reference in New Issue
Block a user