From 68c6f3a7bc5778d0f8f6bb377776b7c6db9bd000 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Thu, 15 Aug 2019 14:38:46 +0200 Subject: [PATCH] :art: Remove some useless code (scan2) --- src/parse/scan2.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/parse/scan2.c b/src/parse/scan2.c index 2e765c88..af3dba5d 100644 --- a/src/parse/scan2.c +++ b/src/parse/scan2.c @@ -321,11 +321,9 @@ ANN2(1,2) static Value func_value(const Env env, const Func f, ADD_REF(v); nspc_add_value(env->curr, f->def->base->xid, v); } else { - if(overload->d.func_ref) { - f->next = overload->d.func_ref->next; - overload->d.func_ref->next = f; - } else - overload->d.func_ref = f; + assert(overload->d.func_ref); + f->next = overload->d.func_ref->next; + overload->d.func_ref->next = f; } return v; } @@ -419,10 +417,6 @@ ANN static m_str func_tmpl_name(const Env env, const Func_Def f) { vector_init(&v); do { const Type t = nspc_lookup_type0(env->curr, id->xid); - if(!t) { - vector_release(&v); - return NULL; - } vector_add(&v, (vtype)t); tlen += strlen(t->name); } while((id = id->next) && ++tlen); -- 2.43.0