summaryrefslogtreecommitdiffstats
path: root/src/expr.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-11-02 10:09:24 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-11-04 12:26:38 -0500
commit9f3be47e4327561bda4a3714ddc00fe1ee159e2e (patch)
treee7cf5864626f8bfd46a041ec9fbe46067591ee03 /src/expr.c
parent6e961567434f50abf850963873988c3365098681 (diff)
downloadbfs-9f3be47e4327561bda4a3714ddc00fe1ee159e2e.tar.xz
expr: Get rid of the extra list node
We can now just use for_arena() to iterate over the allocated bfs_exprs.
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 ca37ffc..e10c61c 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -17,7 +17,7 @@
struct bfs_expr *bfs_expr_new(struct bfs_ctx *ctx, bfs_eval_fn *eval_fn, size_t argc, char **argv, enum bfs_kind kind) {
bfs_assert(kind != BFS_PATH);
- struct bfs_expr *expr = arena_alloc(&ctx->expr_arena);
+ struct bfs_expr *expr = arena_alloc(&ctx->exprs);
if (!expr) {
return NULL;
}
@@ -28,7 +28,6 @@ struct bfs_expr *bfs_expr_new(struct bfs_ctx *ctx, bfs_eval_fn *eval_fn, size_t
expr->argv = argv;
expr->kind = kind;
expr->probability = 0.5;
- SLIST_PREPEND(&ctx->expr_list, expr, freelist);
if (bfs_expr_is_parent(expr)) {
SLIST_INIT(&expr->children);