From b8a09ae02ddb97e854d82112dd8fcb6947c3c54a Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 28 Oct 2022 20:59:23 -0400 Subject: trie: Make leaves into a linked list --- src/ctx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/ctx.c') 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); -- cgit v1.2.3