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

Method opt

basex-core/src/main/java/org/basex/query/func/map/MapItems.java:26–34  ·  view source on GitHub ↗
(final CompileContext cc)

Source from the content-addressed store, hash-verified

24 }
25
26 @Override
27 protected Expr opt(final CompileContext cc) {
28 final Expr map = arg(0);
29 if(map.seqType().type instanceof final MapType mt) {
30 final SeqType vt = mt.valueType();
31 exprType.assign(vt.with(Occ.ZERO_OR_MORE), vt.one() ? map.structSize() : -1);
32 }
33 return this;
34 }
35}

Callers

nothing calls this directly

Calls 7

seqTypeMethod · 0.95
withMethod · 0.95
oneMethod · 0.95
structSizeMethod · 0.95
argMethod · 0.45
valueTypeMethod · 0.45
assignMethod · 0.45

Tested by

no test coverage detected