Checks if the step is redundant. @param seqType type of incoming nodes @return true if the step can be removed
(final SeqType seqType)
| 407 | * @return {@code true} if the step can be removed |
| 408 | */ |
| 409 | final boolean remove(final SeqType seqType) { |
| 410 | // <xml/>/. → <xml/> |
| 411 | // <xml/>/self::node() → <xml/> |
| 412 | // $text/descendant-or-self::text() → $text |
| 413 | // $doc/ancestor-or-self::text() → $doc |
| 414 | final Type type = seqType.type; |
| 415 | return exprs.length == 0 && ( |
| 416 | axis == SELF || |
| 417 | axis == DESCENDANT_OR_SELF && isLeaf(type.kind()) || |
| 418 | axis == ANCESTOR_OR_SELF && type.instanceOf(NodeType.DOCUMENT) |
| 419 | ) && test.subsumes(type) == Boolean.TRUE; |
| 420 | } |
| 421 | |
| 422 | /** |
| 423 | * Adds predicates to the step. |
nothing calls this directly
no test coverage detected