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

Method inline

basex-core/src/main/java/org/basex/query/expr/Logical.java:105–130  ·  view source on GitHub ↗
(final InlineContext ic)

Source from the content-addressed store, hash-verified

103 }
104
105 @Override
106 public Expr inline(final InlineContext ic) throws QueryException {
107 boolean changed = false;
108 final int el = exprs.length;
109 for(int e = 0; e < el; e++) {
110 try {
111 final Expr inlined = exprs[e].inline(ic);
112 if(inlined != null) {
113 exprs[e] = inlined;
114 changed = true;
115 }
116 } catch(final QueryException ex) {
117 // first expression is evaluated eagerly
118 if(e == 0) throw ex;
119
120 // everything behind the error is dead anyway
121 final Expr[] nw = new Expr[e + 1];
122 Array.copy(exprs, e, nw);
123 nw[e] = FnError.get(ex, exprs[e]);
124 exprs = nw;
125 changed = true;
126 break;
127 }
128 }
129 return changed ? optimize(ic.cc) : null;
130 }
131}

Callers

nothing calls this directly

Calls 4

copyMethod · 0.95
getMethod · 0.95
optimizeMethod · 0.95
inlineMethod · 0.65

Tested by

no test coverage detected