Commit e06e6612 authored by Guillaume Charifi's avatar Guillaume Charifi

compiler/parser: Set low increment for class_path & param_names buffers.

parent 948ec300
......@@ -279,7 +279,7 @@ int parse_var_name(wchar_t *name)
static int create_empty_class_path(struct bm_ast_class_path *out)
{
buffer_init(&out->seqs);
buffer_init_hint(&out->seqs, 10);
return 0;
}
......@@ -787,7 +787,7 @@ static int parse_decl_func(struct parser_ctx *ctx, unsigned long *cur_tok_id, st
struct bm_ast_decl_func decl;
decl.base.name = NULL;
buffer_init(&decl.param_names);
buffer_init_hint(&decl.param_names, 10);
if (class_type && ctx->in->tokens[i].type == BM_TOK_NEW)
{
......@@ -823,8 +823,6 @@ static int parse_decl_func(struct parser_ctx *ctx, unsigned long *cur_tok_id, st
i++;
}
buffer_init(&decl.param_names);
create_empty_class_path(&decl.base.type.class_path);
decl.base.type.class_name = NULL;
decl.base.type.nb_generic_params = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment