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

Method simplifyFor

basex-core/src/main/java/org/basex/query/expr/CmpV.java:65–73  ·  view source on GitHub ↗
(final Simplify mode, final CompileContext cc)

Source from the content-addressed store, hash-verified

63 }
64
65 @Override
66 public Expr simplifyFor(final Simplify mode, final CompileContext cc) throws QueryException {
67 Expr expr = this;
68 if(mode.oneOf(Simplify.EBV, Simplify.PREDICATE)) {
69 // E[@x eq 'x'] → E[@x = 'x'] (enables further optimizations)
70 expr = toGeneral(cc, false);
71 }
72 return cc.simplify(this, expr, mode);
73 }
74
75 /**
76 * Tries to rewrite this expression to a general comparison.

Callers

nothing calls this directly

Calls 3

toGeneralMethod · 0.95
oneOfMethod · 0.65
simplifyMethod · 0.45

Tested by

no test coverage detected