MCPcopy
hub / github.com/expr-lang/expr / optimize

Method optimize

compiler/compiler.go:1337–1348  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1335}
1336
1337func (c *compiler) optimize() {
1338 for i, op := range c.bytecode {
1339 switch op {
1340 case OpJumpIfTrue, OpJumpIfFalse, OpJumpIfNil, OpJumpIfNotNil:
1341 target := i + c.arguments[i] + 1
1342 for target < len(c.bytecode) && c.bytecode[target] == op {
1343 target += c.arguments[target] + 1
1344 }
1345 c.arguments[i] = target - i - 1
1346 }
1347 }
1348}
1349
1350func kind(t reflect.Type) reflect.Kind {
1351 if t == nil {

Callers 1

CompileFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected