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

Method flatten

basex-core/src/main/java/org/basex/query/expr/Arr.java:132–145  ·  view source on GitHub ↗

Flattens nested expressions. @param cc compilation context

(final CompileContext cc)

Source from the content-addressed store, hash-verified

130 * @param cc compilation context
131 */
132 protected final void flatten(final CompileContext cc) {
133 // flatten nested expressions
134 final ExprList list = new ExprList(exprs.length);
135 final Class<? extends Arr> clazz = getClass();
136 for(final Expr expr : exprs) {
137 if(clazz.isInstance(expr)) {
138 list.add(expr.args());
139 cc.info(QueryText.OPTFLAT_X_X, expr, (Supplier<?>) this::description);
140 } else {
141 list.add(expr);
142 }
143 }
144 exprs = list.finish();
145 }
146
147 /**
148 * Removes empty expressions.

Callers 6

optimizeMethod · 0.45
optMethod · 0.45
optimizeMethod · 0.45
optimizeMethod · 0.45
optMethod · 0.45
optimizeMethod · 0.45

Calls 4

addMethod · 0.65
argsMethod · 0.65
infoMethod · 0.65
finishMethod · 0.45

Tested by

no test coverage detected