MCPcopy Create free account
hub / github.com/cel-expr/cel-go / NewSetMembershipOptimizer

Function NewSetMembershipOptimizer

ext/sets.go:134–136  ·  view source on GitHub ↗

NewSetMembershipOptimizer rewrites set membership tests using the `in` operator against a list of constant values of enum, int, uint, string, or boolean type into a set membership test against a map where the map keys are the elements of the list.

()

Source from the content-addressed store, hash-verified

132// of constant values of enum, int, uint, string, or boolean type into a set membership test against
133// a map where the map keys are the elements of the list.
134func NewSetMembershipOptimizer() (cel.ASTOptimizer, error) {
135 return setsLib{}, nil
136}
137
138func (setsLib) Optimize(ctx *cel.OptimizerContext, a *ast.AST) *ast.AST {
139 root := ast.NavigateAST(a)

Callers 1

Calls

no outgoing calls

Tested by 1