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.
()
| 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. |
| 134 | func NewSetMembershipOptimizer() (cel.ASTOptimizer, error) { |
| 135 | return setsLib{}, nil |
| 136 | } |
| 137 | |
| 138 | func (setsLib) Optimize(ctx *cel.OptimizerContext, a *ast.AST) *ast.AST { |
| 139 | root := ast.NavigateAST(a) |
no outgoing calls