From: fennecdjay Date: Thu, 15 Aug 2019 12:38:46 +0000 (+0200) Subject: :art: Remove some useless code (scan2) X-Git-Tag: nightly~2280 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=68c6f3a7bc5778d0f8f6bb377776b7c6db9bd000;p=gwion.git :art: Remove some useless code (scan2) --- 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);