eval
All checks were successful
Build and Publish / Metadata (push) Successful in 9s
Build and Publish / BuildAndDeployAmd64 (push) Successful in 1m6s
Build and Publish / BuildAndDeployArm64 (push) Successful in 4m28s

This commit is contained in:
matst80
2025-10-20 17:52:44 +02:00
parent 99c9f611e7
commit e1de5a00a0
4 changed files with 1197 additions and 15 deletions

View File

@@ -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.