Performs various optimizations. @param cc compilation context @return optimized or original expression @throws QueryException query exception
(final CompileContext cc)
| 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. |
nothing calls this directly
no test coverage detected