diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-09-25 13:58:19 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-09-25 14:15:01 -0400 |
commit | 76253d272c50ba08002a47395e47a4f9ce4fb53e (patch) | |
tree | 7878515f6478af2dd98ac2780c6ec9ad11c19c9c /src/trie.h | |
parent | e4304e8b9e74577947647743fd51937ac51956c9 (diff) | |
download | bfs-76253d272c50ba08002a47395e47a4f9ce4fb53e.tar.xz |
Use the new list macros
Diffstat (limited to 'src/trie.h')
-rw-r--r-- | src/trie.h | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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 |