From d63885a495d2314a5ef76337605a9ebeefb26218 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sun, 25 Feb 2018 19:23:52 +0000 Subject: `array_make` --- src/check_decl.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/check_decl.cpp') diff --git a/src/check_decl.cpp b/src/check_decl.cpp index c37e97906..b61bce253 100644 --- a/src/check_decl.cpp +++ b/src/check_decl.cpp @@ -100,8 +100,7 @@ void check_init_variables(Checker *c, Entity **lhs, isize lhs_count, Array lhs which would mean there would need to be // an extra allocation - Array operands = {}; - array_init(&operands, c->tmp_allocator, 2*lhs_count); + auto operands = array_make(c->tmp_allocator, 0, 2*lhs_count); check_unpack_arguments(c, lhs, lhs_count, &operands, inits, true); isize rhs_count = operands.count; @@ -758,7 +757,7 @@ void check_proc_group_decl(Checker *c, Entity *pg_entity, DeclInfo *d) { ast_node(pg, ProcGroup, d->init_expr); - array_init(&pge->entities, c->allocator, pg->args.count); + pge->entities = array_make(c->allocator, 0, pg->args.count); // NOTE(bill): This must be set here to prevent cycles in checking if someone // places the entity within itself -- cgit v1.2.3