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

Method emptySteps

basex-core/src/main/java/org/basex/query/expr/path/Path.java:427–438  ·  view source on GitHub ↗

Checks if the path contains empty steps. @param rt root at compile time (can be null) @return result of check

(final Expr rt)

Source from the content-addressed store, hash-verified

425 * @return result of check
426 */
427 private boolean emptySteps(final Expr rt) {
428 if(rt != null) {
429 Expr prev = rt;
430 for(final Expr step : steps) {
431 final SeqType seqType = prev.seqType();
432 if(seqType.type instanceof NodeType && step instanceof final Step stp &&
433 stp.empty(seqType)) return true;
434 prev = step;
435 }
436 }
437 return false;
438 }
439
440 /**
441 * Checks if a path can be evaluated iteratively (i.e., if all results will be in distinct

Callers 1

removeEmptyMethod · 0.95

Calls 2

seqTypeMethod · 0.95
emptyMethod · 0.45

Tested by

no test coverage detected