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

Method opt

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

Performs various optimizations. @param cc compilation context @return optimized or original expression @throws QueryException query exception

(final CompileContext cc)

Source from the content-addressed store, hash-verified

102 * @throws QueryException query exception
103 */
104 final Expr opt(final CompileContext cc) throws QueryException {
105 final CmpOp op = cmpOp();
106 Expr expr = optPos(op, cc);
107 if(expr == this) expr = optEqual(op, cc);
108 if(expr == this) expr = optCount(op, cc);
109 if(expr == this) expr = optBoolean(op, cc);
110 if(expr == this) expr = optEmptyString(op, cc);
111 if(expr == this) expr = optStringLength(op, cc);
112 return expr;
113 }
114
115 /**
116 * Tries to simplify an expression with equal operands.

Callers

nothing calls this directly

Calls 7

cmpOpMethod · 0.95
optPosMethod · 0.95
optEqualMethod · 0.95
optCountMethod · 0.95
optBooleanMethod · 0.95
optEmptyStringMethod · 0.95
optStringLengthMethod · 0.95

Tested by

no test coverage detected