xpath OPTIMIZE xpath sorting optimalizations
In release build, all sorting is skipped and
it is assumed that the only XPath construct
that can break the ordering is union, in that
case a simple merge of sets is performed (in O(n)).
To increase chances of detecting cases when
this assumption does not hold, in debug build
sorting is done where the ordering is required,
and if the original set is not ordered
an error is printed.
diff --git a/src/resolve.c b/src/resolve.c
index 0c18d43..86af9d6 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -4174,7 +4174,7 @@
lyxp_set_cast(&set, LYXP_SET_BOOLEAN, node, LYXP_MUST);
- if (!set.value.bool) {
+ if (!set.val.bool) {
LOGVAL(LYE_NOMUST, LY_VLOG_LYD, node, must[i].expr);
if (must[i].emsg) {
LOGVAL(LYE_SPEC, LY_VLOG_LYD, node, must[i].emsg);
@@ -4317,7 +4317,7 @@
/* set boolean result of the condition */
lyxp_set_cast(&set, LYXP_SET_BOOLEAN, node, LYXP_WHEN);
- if (!set.value.bool) {
+ if (!set.val.bool) {
ly_vlog_hide(1);
LOGVAL(LYE_NOWHEN, LY_VLOG_LYD, node, ((struct lys_node_container *)node->schema)->when->cond);
ly_vlog_hide(0);
@@ -4352,7 +4352,7 @@
}
lyxp_set_cast(&set, LYXP_SET_BOOLEAN, ctx_node, LYXP_WHEN);
- if (!set.value.bool) {
+ if (!set.val.bool) {
ly_vlog_hide(1);
LOGVAL(LYE_NOWHEN, LY_VLOG_LYD, node, ((struct lys_node_uses *)parent)->when->cond);
ly_vlog_hide(0);
@@ -4384,7 +4384,7 @@
lyxp_set_cast(&set, LYXP_SET_BOOLEAN, ctx_node, LYXP_WHEN);
- if (!set.value.bool) {
+ if (!set.val.bool) {
ly_vlog_hide(1);
LOGVAL(LYE_NOWHEN, LY_VLOG_LYD, node, ((struct lys_node_augment *)parent->parent)->when->cond);
ly_vlog_hide(0);