summaryrefslogtreecommitdiffstats
path: root/src/ctx.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2022-10-28 20:59:23 -0400
committerTavian Barnes <tavianator@tavianator.com>2022-10-29 11:24:19 -0400
commitb8a09ae02ddb97e854d82112dd8fcb6947c3c54a (patch)
treeff257d993a4fb295a19204c5a0968e750025e44e /src/ctx.c
parentdd13a1deee5bda50e76046baa7290b4e0991feea (diff)
downloadbfs-b8a09ae02ddb97e854d82112dd8fcb6947c3c54a.tar.xz
trie: Make leaves into a linked list
Diffstat (limited to 'src/ctx.c')
-rw-r--r--src/ctx.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/ctx.c b/src/ctx.c
index 8ba2f38..b2f7d56 100644
--- a/src/ctx.c
+++ b/src/ctx.c
@@ -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);