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

Method Optimize

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

Source from the content-addressed store, hash-verified

1380type testVariadicLogicOptimizer struct{}
1381
1382func (t *testVariadicLogicOptimizer) Optimize(ctx *OptimizerContext, a *ast.AST) *ast.AST {
1383 call := ctx.NewCall(operators.LogicalAnd, ctx.NewIdent("x"), ctx.NewLiteral(types.True), ctx.NewIdent("y"))
1384 return ctx.NewAST(call)
1385}
1386
1387func TestConstantFoldingOptimizer_VariadicShortcircuitLogic(t *testing.T) {
1388 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