MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / Balance

Method Balance

parser/parser.cc:579–584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

577}
578
579Expr ExpressionBalancer::Balance() {
580 if (terms_.size() == 1) {
581 return std::move(terms_[0]);
582 }
583 return BalancedTree(0, ops_.size() - 1);
584}
585
586Expr ExpressionBalancer::BalancedTree(int lo, int hi) {
587 int mid = (lo + hi + 1) / 2;

Callers 2

visitConditionalOrMethod · 0.80
visitConditionalAndMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected