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

Method optimize

basex-core/src/main/java/org/basex/query/expr/CmpSR.java:62–70  ·  view source on GitHub ↗
(final CompileContext cc)

Source from the content-addressed store, hash-verified

60 }
61
62 @Override
63 public Expr optimize(final CompileContext cc) throws QueryException {
64 expr = expr.simplifyFor(Simplify.STRING, cc);
65
66 final SeqType st = expr.seqType();
67 single = st.zeroOrOne() && !st.mayBeWrapped();
68
69 return expr instanceof Value ? cc.preEval(this) : this;
70 }
71
72 /**
73 * Tries to convert the specified expression into a range expression.

Callers 2

getMethod · 0.45
mergeEbvMethod · 0.45

Calls 5

zeroOrOneMethod · 0.95
mayBeWrappedMethod · 0.95
seqTypeMethod · 0.65
simplifyForMethod · 0.45
preEvalMethod · 0.45

Tested by

no test coverage detected