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

Method optimize

basex-core/src/main/java/org/basex/query/expr/Preds.java:93–100  ·  view source on GitHub ↗

Optimizes all predicates. @param cc compilation context @param root root expression @return whether the evaluation can be skipped @throws QueryException query exception

(final CompileContext cc, final Expr root)

Source from the content-addressed store, hash-verified

91 * @throws QueryException query exception
92 */
93 protected final boolean optimize(final CompileContext cc, final Expr root) throws QueryException {
94 return cc.ok(root, true, () -> {
95 final ExprList list = new ExprList(exprs.length);
96 for(final Expr expr : exprs) optimize(expr, list, root, cc);
97 exprs = list.finish();
98 return optimizeEbv(false, true, cc);
99 }) || optimizeType(root);
100 }
101
102 /**
103 * Optimizes a predicate.

Callers 2

compileMethod · 0.95
flattenEbvMethod · 0.45

Calls 15

optimizeTypeMethod · 0.95
oneMethod · 0.95
argMethod · 0.95
getMethod · 0.95
infoMethod · 0.95
getMethod · 0.95
mayBePositionalMethod · 0.95
seqTypeMethod · 0.95
getMethod · 0.95
getMethod · 0.95
hasMethod · 0.95
argsMethod · 0.95

Tested by

no test coverage detected