libyang REFACTOR avoid constant literals
Improve readability of the code.
Includes also unification of "no break in the case" comment to "fall
through".
diff --git a/src/set.c b/src/set.c
index 1eb229b..5ed43f4 100644
--- a/src/set.c
+++ b/src/set.c
@@ -141,10 +141,12 @@
}
if (set->size == set->count) {
- new = realloc(set->objs, (set->size + 8) * sizeof *(set->objs));
+#define SET_SIZE_STEP 8
+ new = realloc(set->objs, (set->size + SET_SIZE_STEP) * sizeof *(set->objs));
LY_CHECK_ERR_RET(!new, LOGMEM(NULL), LY_EMEM);
- set->size += 8;
+ set->size += SET_SIZE_STEP;
set->objs = new;
+#undef SET_SIZE_STEP
}
if (index_p) {