summaryrefslogtreecommitdiffstats
path: root/src/color.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/color.c
parentdd13a1deee5bda50e76046baa7290b4e0991feea (diff)
downloadbfs-b8a09ae02ddb97e854d82112dd8fcb6947c3c54a.tar.xz
trie: Make leaves into a linked list
Diffstat (limited to 'src/color.c')
-rw-r--r--src/color.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/color.c b/src/color.c
index 6908628..f96813f 100644
--- a/src/color.c
+++ b/src/color.c
@@ -486,17 +486,14 @@ struct colors *parse_colors(void) {
void free_colors(struct colors *colors) {
if (colors) {
- struct trie_leaf *leaf;
- while ((leaf = trie_first_leaf(&colors->ext_colors))) {
+ TRIE_FOR_EACH(&colors->ext_colors, leaf) {
dstrfree(leaf->value);
- trie_remove(&colors->ext_colors, leaf);
}
trie_destroy(&colors->ext_colors);
- while ((leaf = trie_first_leaf(&colors->names))) {
+ TRIE_FOR_EACH(&colors->names, leaf) {
char **field = leaf->value;
dstrfree(*field);
- trie_remove(&colors->names, leaf);
}
trie_destroy(&colors->names);