MCPcopy Create free account
hub / github.com/BaseXdb/basex / optimize

Method optimize

basex-core/src/main/java/org/basex/query/expr/Logical.java:39–51  ·  view source on GitHub ↗
(final CompileContext cc)

Source from the content-addressed store, hash-verified

37 }
38
39 @Override
40 public final Expr optimize(final CompileContext cc) throws QueryException {
41 flatten(cc);
42 exprs = simplifyAll(Simplify.EBV, cc);
43
44 final boolean or = or();
45 if(optimizeEbv(or, false, cc)) return cc.replaceWith(this, Bln.get(or));
46
47 final int el = exprs.length;
48 if(el == 0) return Bln.get(!or);
49 if(el == 1) return cc.function(Function.BOOLEAN, info, exprs);
50 return this;
51 }
52
53 @Override
54 public final Bln item(final QueryContext qc, final InputInfo ii) throws QueryException {

Callers 3

compileMethod · 0.95
inlineMethod · 0.95
indexAccessibleMethod · 0.45

Calls 7

orMethod · 0.95
getMethod · 0.95
simplifyAllMethod · 0.80
replaceWithMethod · 0.80
flattenMethod · 0.45
optimizeEbvMethod · 0.45
functionMethod · 0.45

Tested by

no test coverage detected