NewInliningOptimizer creates and optimizer which replaces variables with expression definitions. If a variable occurs one time, the variable is replaced by the inline definition. If the variable occurs more than once, the variable occurences are replaced by a cel.bind() call.
(inlineVars ...*InlineVariable)
| 68 | // If a variable occurs one time, the variable is replaced by the inline definition. If the |
| 69 | // variable occurs more than once, the variable occurences are replaced by a cel.bind() call. |
| 70 | func NewInliningOptimizer(inlineVars ...*InlineVariable) ASTOptimizer { |
| 71 | return &inliningOptimizer{variables: inlineVars} |
| 72 | } |
| 73 | |
| 74 | type inliningOptimizer struct { |
| 75 | variables []*InlineVariable |
no outgoing calls