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

Method removeEmpty

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

Removes empty expressions. @param cc compilation context

(final CompileContext cc)

Source from the content-addressed store, hash-verified

149 * @param cc compilation context
150 */
151 protected final void removeEmpty(final CompileContext cc) {
152 if(!((Checks<Expr>) expr -> expr == Empty.VALUE).any(exprs)) return;
153
154 final ExprList list = new ExprList(exprs.length - 1);
155 for(final Expr expr : exprs) {
156 if(expr != Empty.VALUE) list.add(expr);
157 }
158 cc.info(QueryText.OPTREMOVE_X_X, Empty.VALUE, (Supplier<?>) this::description);
159 exprs = list.finish();
160 }
161
162 /**
163 * Returns the first expression that yields an empty sequence. If all expressions return non-empty

Callers 2

optimizeMethod · 0.45
optimizeMethod · 0.45

Calls 4

anyMethod · 0.80
addMethod · 0.65
infoMethod · 0.65
finishMethod · 0.45

Tested by

no test coverage detected