(final CompileContext cc)
| 30 | } |
| 31 | |
| 32 | @Override |
| 33 | public Expr optimize(final CompileContext cc) throws QueryException { |
| 34 | exprs = simplifyAll(Simplify.STRING, cc); |
| 35 | |
| 36 | if(values(true, cc) && !(exprs[0] instanceof Str)) { |
| 37 | final byte[] value = atomValue(cc.qc, false); |
| 38 | exprs[0] = value != null ? Str.get(value) : Empty.VALUE; |
| 39 | } |
| 40 | |
| 41 | final Expr expr = exprs[0]; |
| 42 | final SeqType st = expr.seqType(); |
| 43 | if(st.zero()) return cc.replaceWith(this, expr); |
| 44 | |
| 45 | final boolean atom = !st.mayBeWrapped(); |
| 46 | if(st.oneOrMore() && atom) exprType.assign(Occ.EXACTLY_ONE); |
| 47 | return this; |
| 48 | } |
| 49 | |
| 50 | @Override |
| 51 | public Item item(final QueryContext qc, final InputInfo ii) throws QueryException { |
nothing calls this directly
no test coverage detected