From eed4ca8c78f98c6a4d29e5c75171be39812bd567 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Fri, 28 Oct 2022 05:15:31 +0200 Subject: [PATCH] :art: remove vector_realloc call in the compiler --- src/emit/emit.c | 2 -- src/parse/check.c | 1 - 2 files changed, 3 deletions(-) diff --git a/src/emit/emit.c b/src/emit/emit.c index ae359900..cd116501 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -184,7 +184,6 @@ ANN static m_bool emit_defers(const Emitter emit) { if(s) CHECK_BB(emit_stmt(emit, s)); } VLEN(v) = i; - vector_realloc(v); return GW_OK; } @@ -2121,7 +2120,6 @@ ANN static void set_pcs(const Vector v, const m_uint pc) { instr->m_val = pc; } VLEN(v) = i - 1; - vector_realloc(v); } ANN static void emit_pop_stack(const Emitter emit, const m_uint index) { diff --git a/src/parse/check.c b/src/parse/check.c index 2927616e..7e576f07 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -596,7 +596,6 @@ ANN m_bool check_traverse_fdef(const Env env, const Func_Def fdef) { Vector w = (Vector)&env->curr->info->value->ptr; m_uint i = vector_size(w); while (i-- > 1) vector_add(&v, vector_at(w, i)); - vector_realloc(w); const m_bool ret = traverse_func_def(env, fdef); for (m_uint i = vector_size(&v) + 1; --i;) vector_add((Vector)&env->curr->info->value->ptr, vector_at(&v, i - 1)); -- 2.43.0