set CHANGE replace LY_SET_OPT_USEASLIST by a single flag in ly_set_add()
There was just a single option and the ly_set API is quite stable for a
long time, so there will be hardly any new option. So instead of an
option bitmask with a single value, make the ly_set_add() parameter only
a single flag to switch off checking (and ignoring) items already
present in the set.
diff --git a/src/tree_data.c b/src/tree_data.c
index 1423421..0558f37 100644
--- a/src/tree_data.c
+++ b/src/tree_data.c
@@ -1420,7 +1420,7 @@
if (ret == LY_EINCOMPLETE) {
if (node_types) {
/* remember to resolve type */
- LY_CHECK_RET(ly_set_add(node_types, node, LY_SET_OPT_USEASLIST, NULL));
+ LY_CHECK_RET(ly_set_add(node_types, node, 1, NULL));
}
} else if (ret) {
return ret;
@@ -1430,7 +1430,7 @@
if (iter->when && node_when) {
/* remember to resolve when */
- LY_CHECK_RET(ly_set_add(node_when, node, LY_SET_OPT_USEASLIST, NULL));
+ LY_CHECK_RET(ly_set_add(node_when, node, 1, NULL));
}
if (diff) {
/* add into diff */
@@ -1448,7 +1448,7 @@
if (ret == LY_EINCOMPLETE) {
if (node_types) {
/* remember to resolve type */
- LY_CHECK_RET(ly_set_add(node_types, node, LY_SET_OPT_USEASLIST, NULL));
+ LY_CHECK_RET(ly_set_add(node_types, node, 1, NULL));
}
} else if (ret) {
return ret;
@@ -1458,7 +1458,7 @@
if (iter->when && node_when) {
/* remember to resolve when */
- LY_CHECK_RET(ly_set_add(node_when, node, LY_SET_OPT_USEASLIST, NULL));
+ LY_CHECK_RET(ly_set_add(node_when, node, 1, NULL));
}
if (diff) {
/* add into diff */
@@ -3347,7 +3347,7 @@
for (i = 0; i < xp_set.used; ++i) {
if (xp_set.val.nodes[i].type == LYXP_NODE_ELEM) {
- ret = ly_set_add(*set, xp_set.val.nodes[i].node, LY_SET_OPT_USEASLIST, NULL);
+ ret = ly_set_add(*set, xp_set.val.nodes[i].node, 1, NULL);
LY_CHECK_GOTO(ret, cleanup);
}
}