Simplifies all expressions for requests of the specified type. @param mode mode of simplification @param cc compilation context @return simplified or original expressions @throws QueryException query exception
(final Simplify mode, final CompileContext cc)
| 113 | * @throws QueryException query exception |
| 114 | */ |
| 115 | protected final Expr[] simplifyAll(final Simplify mode, final CompileContext cc) |
| 116 | throws QueryException { |
| 117 | |
| 118 | boolean changed = false; |
| 119 | final ExprList list = new ExprList(exprs.length); |
| 120 | for(final Expr expr : exprs) { |
| 121 | final Expr ex = expr.simplifyFor(mode, cc); |
| 122 | if(ex != expr) changed = true; |
| 123 | list.add(ex); |
| 124 | } |
| 125 | return changed ? list.finish() : exprs; |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * Flattens nested expressions. |
no test coverage detected