diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2019-04-20 12:05:43 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2019-04-20 12:16:18 -0400 |
commit | 4eeae2264cf32e67a0aac46293752251328e2745 (patch) | |
tree | 2591dd7df8d6d2f2d3869872d031c854c8e8e440 /color.c | |
parent | 36f690a4400022b938542e1feb6dd905208ff55c (diff) | |
download | bfs-4eeae2264cf32e67a0aac46293752251328e2745.tar.xz |
trie: Make trie_remove() take a leaf instead of a key
Diffstat (limited to 'color.c')
-rw-r--r-- | color.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); |