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

Function NewInliningOptimizer

cel/inlining.go:70–72  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
70func NewInliningOptimizer(inlineVars ...*InlineVariable) ASTOptimizer {
71 return &inliningOptimizer{variables: inlineVars}
72}
73
74type inliningOptimizer struct {
75 variables []*InlineVariable

Calls

no outgoing calls