summaryrefslogtreecommitdiffstats
path: root/src/trie.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-09-25 13:58:19 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-09-25 14:15:01 -0400
commit76253d272c50ba08002a47395e47a4f9ce4fb53e (patch)
tree7878515f6478af2dd98ac2780c6ec9ad11c19c9c /src/trie.h
parente4304e8b9e74577947647743fd51937ac51956c9 (diff)
downloadbfs-76253d272c50ba08002a47395e47a4f9ce4fb53e.tar.xz
Use the new list macros
Diffstat (limited to 'src/trie.h')
-rw-r--r--src/trie.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/trie.h b/src/trie.h
index dfaae15..2f51db5 100644
--- a/src/trie.h
+++ b/src/trie.h
@@ -6,6 +6,7 @@
#include "config.h"
#include "alloc.h"
+#include "list.h"
#include <stddef.h>
#include <stdint.h>
@@ -141,9 +142,7 @@ void trie_destroy(struct trie *trie);
/**
* Iterate over the leaves of a trie.
*/
-#define TRIE_FOR_EACH(trie, leaf) \
- for (struct trie_leaf *leaf = (trie)->head, *_next; \
- leaf && (_next = leaf->next, true); \
- leaf = _next)
+#define for_trie(leaf, trie) \
+ for_list(struct trie_leaf, leaf, trie)
#endif // BFS_TRIE_H