summaryrefslogtreecommitdiffstats
path: root/color.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2019-04-20 12:05:43 -0400
committerTavian Barnes <tavianator@tavianator.com>2019-04-20 12:16:18 -0400
commit4eeae2264cf32e67a0aac46293752251328e2745 (patch)
tree2591dd7df8d6d2f2d3869872d031c854c8e8e440 /color.c
parent36f690a4400022b938542e1feb6dd905208ff55c (diff)
downloadbfs-4eeae2264cf32e67a0aac46293752251328e2745.tar.xz
trie: Make trie_remove() take a leaf instead of a key
Diffstat (limited to 'color.c')
-rw-r--r--color.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/color.c b/color.c
index c6e58cd..17d59e6 100644
--- a/color.c
+++ b/color.c
@@ -160,7 +160,7 @@ static int set_ext_color(struct colors *colors, char *key, const char *value) {
struct trie_leaf *match;
while ((match = trie_find_postfix(&colors->ext_colors, key))) {
dstrfree(match->value);
- trie_remove_mem(&colors->ext_colors, match->key, match->length);
+ trie_remove(&colors->ext_colors, match);
}
struct trie_leaf *leaf = trie_insert_str(&colors->ext_colors, key);
@@ -473,14 +473,14 @@ void free_colors(struct colors *colors) {
struct trie_leaf *leaf;
while ((leaf = trie_first_leaf(&colors->ext_colors))) {
dstrfree(leaf->value);
- trie_remove_mem(&colors->ext_colors, leaf->key, leaf->length);
+ trie_remove(&colors->ext_colors, leaf);
}
trie_destroy(&colors->ext_colors);
while ((leaf = trie_first_leaf(&colors->names))) {
char **field = leaf->value;
dstrfree(*field);
- trie_remove_mem(&colors->names, leaf->key, leaf->length);
+ trie_remove(&colors->names, leaf);
}
trie_destroy(&colors->names);