diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2022-10-28 20:59:23 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2022-10-29 11:24:19 -0400 |
commit | b8a09ae02ddb97e854d82112dd8fcb6947c3c54a (patch) | |
tree | ff257d993a4fb295a19204c5a0968e750025e44e /src/ctx.c | |
parent | dd13a1deee5bda50e76046baa7290b4e0991feea (diff) | |
download | bfs-b8a09ae02ddb97e854d82112dd8fcb6947c3c54a.tar.xz |
trie: Make leaves into a linked list
Diffstat (limited to 'src/ctx.c')
-rw-r--r-- | src/ctx.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -270,8 +270,7 @@ int bfs_ctx_free(struct bfs_ctx *ctx) { bfs_groups_free(ctx->groups); bfs_users_free(ctx->users); - struct trie_leaf *leaf; - while ((leaf = trie_first_leaf(&ctx->files))) { + TRIE_FOR_EACH(&ctx->files, leaf) { struct bfs_ctx_file *ctx_file = leaf->value; if (bfs_ctx_fclose(ctx, ctx_file) != 0) { @@ -282,7 +281,6 @@ int bfs_ctx_free(struct bfs_ctx *ctx) { } free(ctx_file); - trie_remove(&ctx->files, leaf); } trie_destroy(&ctx->files); |