Less
This commit is contained in:
@@ -70,16 +70,12 @@ void add_leaf(stone_t* root, stone_t* leaf) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint64_t call_on_leaf(stone_t *leaf, void (*cb)(stone_t*, void*), void* ctx) {
|
uint64_t call_on_leaf(stone_t *leaf, void (*cb)(stone_t*, void*), void* ctx) {
|
||||||
//printf("%lu\n", leaf->value);
|
|
||||||
cb(leaf, ctx);
|
|
||||||
|
|
||||||
if (*(int*)ctx == 0) {
|
if (*(int*)ctx == 0) {
|
||||||
for (int i = 0; i < leaf->leaf_count; i++) {
|
|
||||||
free(leaf->leafs[i]);
|
|
||||||
}
|
|
||||||
free(leaf);
|
free(leaf);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
cb(leaf, ctx);
|
||||||
|
|
||||||
|
|
||||||
uint64_t sum = 0;
|
uint64_t sum = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user