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

Method simplifyFor

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

Source from the content-addressed store, hash-verified

129 }
130
131 @Override
132 public Expr simplifyFor(final Simplify mode, final CompileContext cc) throws QueryException {
133 Expr expr = this;
134 if(mode.oneOf(Simplify.EBV, Simplify.PREDICATE)) {
135 for(final Expr ex : exprs) {
136 // boolean(a union <a/>) → boolean(true())
137 if(ex.seqType().instanceOf(Types.GNODE_OM) && !expr.has(Flag.NDT)) expr = Bln.TRUE;
138 }
139 }
140 return cc.simplify(this, expr, mode);
141 }
142
143 @Override
144 public Expr copy(final CompileContext cc, final IntObjectMap<Var> vm) {

Callers

nothing calls this directly

Calls 5

hasMethod · 0.95
oneOfMethod · 0.65
instanceOfMethod · 0.65
seqTypeMethod · 0.65
simplifyMethod · 0.45

Tested by

no test coverage detected