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

Method optPos

basex-core/src/main/java/org/basex/query/expr/Cmp.java:370–376  ·  view source on GitHub ↗

Positional optimizations. @param op comparison operator @param cc compilation context @return optimized or original expression @throws QueryException query exception

(final CmpOp op, final CompileContext cc)

Source from the content-addressed store, hash-verified

368 * @throws QueryException query exception
369 */
370 private Expr optPos(final CmpOp op, final CompileContext cc) throws QueryException {
371 if(POSITION.is(exprs[0]) && exprs[1].seqType().type.isNumberOrUntyped()) {
372 final Expr expr = Pos.get(exprs[1], op, info, cc, null);
373 if(expr != null) return expr;
374 }
375 return this;
376 }
377
378 /**
379 * Analyzes the comparison and returns its optimization type.

Callers 1

optMethod · 0.95

Calls 4

getMethod · 0.95
isMethod · 0.65
isNumberOrUntypedMethod · 0.65
seqTypeMethod · 0.65

Tested by

no test coverage detected