This commit is contained in:
XANTRONIX Development 2017-11-27 18:47:23 -06:00
parent e96f8edd98
commit 680e42c8ef
2 changed files with 6 additions and 6 deletions

View file

@ -23,10 +23,10 @@ static void _destroy(skipstone_map *map, void (*destructor)(void *), int depth)
for (i=0; i<SKIPSTONE_MAP_SLOTS; i++) {
if (map[i].next) {
if (destructor && depth == SKIPSTONE_MAP_DEPTH) {
destructor(map[i].value);
} else {
if (depth < SKIPSTONE_MAP_DEPTH) {
_destroy(map[i].next, destructor, depth + 1);
} else if (destructor) {
destructor(map[i].value);
}
}
}

View file

@ -23,10 +23,10 @@ static void _destroy(skipstone_map *map, void (*destructor)(void *), int depth)
for (i=0; i<SKIPSTONE_MAP_SLOTS; i++) {
if (map[i].next) {
if (destructor && depth == SKIPSTONE_MAP_DEPTH) {
destructor(map[i].value);
} else {
if (depth < SKIPSTONE_MAP_DEPTH) {
_destroy(map[i].next, destructor, depth + 1);
} else if (destructor) {
destructor(map[i].value);
}
}
}