summaryrefslogtreecommitdiffstats
path: root/src/expr.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-09-19 12:14:06 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-09-19 12:14:06 -0400
commitcf2eb17c48a23d49bf517df58e34e30529c16576 (patch)
treee746c589fb25d62bdc7ea9803a8f2e983b563ba5 /src/expr.c
parent5307ef2ed38b665892798aa10295dd68401a38df (diff)
downloadbfs-cf2eb17c48a23d49bf517df58e34e30529c16576.tar.xz
list: New drain_slist() macro
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/expr.c b/src/expr.c
index 110e9b7..ca37ffc 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -68,8 +68,7 @@ void bfs_expr_append(struct bfs_expr *expr, struct bfs_expr *child) {
}
void bfs_expr_extend(struct bfs_expr *expr, struct bfs_exprs *children) {
- while (!SLIST_EMPTY(children)) {
- struct bfs_expr *child = SLIST_POP(children);
+ drain_slist (struct bfs_expr, child, children) {
bfs_expr_append(expr, child);
}
}