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/set.c b/src/set.c
index f4c718a..095fb3d 100644
--- a/src/set.c
+++ b/src/set.c
@@ -121,13 +121,13 @@
}
API LY_ERR
-ly_set_add(struct ly_set *set, void *object, uint32_t options, uint32_t *index_p)
+ly_set_add(struct ly_set *set, void *object, ly_bool list, uint32_t *index_p)
{
void **new;
LY_CHECK_ARG_RET(NULL, set, LY_EINVAL);
- if (!(options & LY_SET_OPT_USEASLIST)) {
+ if (!list) {
/* search for duplication */
for (uint32_t i = 0; i < set->count; i++) {
if (set->objs[i] == object) {