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

Method mergeEbv

basex-core/src/main/java/org/basex/query/expr/CmpIR.java:164–184  ·  view source on GitHub ↗
(final Expr ex, final boolean or, final CompileContext cc)

Source from the content-addressed store, hash-verified

162 }
163
164 @Override
165 public Expr mergeEbv(final Expr ex, final boolean or, final CompileContext cc)
166 throws QueryException {
167
168 Long newMin = null, newMax = null;
169 if(ex instanceof final CmpIR cmp) {
170 newMin = cmp.min;
171 newMax = cmp.max;
172 } else if(ex instanceof final CmpG cmp && cmp.op == CmpOp.EQ &&
173 ex.arg(1) instanceof final Itr itr) {
174 newMin = itr.itr();
175 newMax = newMin;
176 }
177 if(newMin == null || !expr.equals(ex.arg(0)) || or && (max < newMin || min > newMax))
178 return null;
179
180 // determine common minimum and maximum value
181 newMin = or ? Math.min(min, newMin) : Math.max(min, newMin);
182 newMax = or ? Math.max(max, newMax) : Math.min(max, newMax);
183 return get(cc, info, expr, newMin, newMax);
184 }
185
186 @Override
187 public boolean indexAccessible(final IndexInfo ii) throws QueryException {

Callers

nothing calls this directly

Calls 6

getMethod · 0.95
argMethod · 0.45
itrMethod · 0.45
equalsMethod · 0.45
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected