From cf2eb17c48a23d49bf517df58e34e30529c16576 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 19 Sep 2024 12:14:06 -0400 Subject: list: New drain_slist() macro --- src/expr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/expr.c') 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); } } -- cgit v1.2.3