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

Method Optimize

cel/folding_test.go:1919–1922  ·  view source on GitHub ↗
(ctx *OptimizerContext, a *ast.AST)

Source from the content-addressed store, hash-verified

1917type testVariadicLogicOptimizer struct{}
1918
1919func (t *testVariadicLogicOptimizer) Optimize(ctx *OptimizerContext, a *ast.AST) *ast.AST {
1920 call := ctx.NewCall(operators.LogicalAnd, ctx.NewIdent("x"), ctx.NewLiteral(types.True), ctx.NewIdent("y"))
1921 return ctx.NewAST(call)
1922}
1923
1924func TestConstantFoldingOptimizer_VariadicShortcircuitLogic(t *testing.T) {
1925 env, err := NewEnv(Variable("x", BoolType), Variable("y", BoolType))

Callers

nothing calls this directly

Calls 4

NewASTMethod · 0.80
NewCallMethod · 0.65
NewIdentMethod · 0.65
NewLiteralMethod · 0.65

Tested by

no test coverage detected