diff --git a/day11/c/day11.c b/day11/c/day11.c index 9026f59..ba8faad 100644 --- a/day11/c/day11.c +++ b/day11/c/day11.c @@ -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) { - //printf("%lu\n", leaf->value); - cb(leaf, ctx); - if (*(int*)ctx == 0) { - for (int i = 0; i < leaf->leaf_count; i++) { - free(leaf->leafs[i]); - } free(leaf); return 1; } + cb(leaf, ctx); + uint64_t sum = 0;