summaryrefslogtreecommitdiffstats
path: root/trie.h
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 /trie.h
parent36f690a4400022b938542e1feb6dd905208ff55c (diff)
downloadbfs-4eeae2264cf32e67a0aac46293752251328e2745.tar.xz
trie: Make trie_remove() take a leaf instead of a key
Diffstat (limited to 'trie.h')
-rw-r--r--trie.h24
1 files changed, 4 insertions, 20 deletions
diff --git a/trie.h b/trie.h
index ae554e7..7b073f1 100644
--- a/trie.h
+++ b/trie.h
@@ -140,30 +140,14 @@ struct trie_leaf *trie_insert_str(struct trie *trie, const char *key);
struct trie_leaf *trie_insert_mem(struct trie *trie, const void *key, size_t length);
/**
- * Remove a string key from a trie.
+ * Remove a leaf from a trie.
*
* @param trie
* The trie to modify.
- * @param key
- * The key to remove.
- * @return
- * Whether the key was found.
- */
-bool trie_remove_str(struct trie *trie, const char *key);
-
-/**
- * Remove a fixed-size key from a trie.
- *
- * @param trie
- * The trie to modify.
- * @param key
- * The key to remove.
- * @param size
- * The size of the key in bytes.
- * @return
- * Whether the key was found.
+ * @param leaf
+ * The leaf to remove.
*/
-bool trie_remove_mem(struct trie *trie, const void *key, size_t size);
+void trie_remove(struct trie *trie, struct trie_leaf *leaf);
/**
* Destroy a trie and its contents.