From 7d44183b9bd0dae46273f4eeaadc1e90c68cea8e Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Wed, 11 Nov 2020 00:17:28 +0100 Subject: [PATCH] :art: Coding style (one line if/else) --- src/parse/func_resolve_tmpl.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/parse/func_resolve_tmpl.c b/src/parse/func_resolve_tmpl.c index 4f623be7..0910eb8b 100644 --- a/src/parse/func_resolve_tmpl.c +++ b/src/parse/func_resolve_tmpl.c @@ -116,12 +116,10 @@ ANN static Func func_match(const Env env, struct ResolverArgs* f_ptr_args) { const Func_Def fdef = (Func_Def)cpy_func_def(env->gwion->mp, value->d.func_ref->def); fdef->base->tmpl->call = cpy_type_list(env->gwion->mp, types); fdef->base->tmpl->base = i; - if((m_func = ensure_tmpl(env, fdef, exp))) { + if((m_func = ensure_tmpl(env, fdef, exp))) break; - } - if(!fdef->base->func) { + if(!fdef->base->func) free_func_def(env->gwion->mp, fdef); - } } } return m_func; @@ -138,9 +136,9 @@ ANN static Func _find_template_match(const Env env, const Value v, const Exp_Cal struct ResolverArgs f_ptr_args = {.v = v, .e = exp, .tmpl_name = tmpl_name, m_func = m_func, .types = types}; CHECK_BO(envset_push(&es, v->from->owner_class, v->from->owner)) (void)env_push(env, v->from->owner_class, v->from->owner); - if(is_fptr(env->gwion, v->type)) { + if(is_fptr(env->gwion, v->type)) m_func = fptr_match(env, &f_ptr_args); - } else { + else m_func = func_match(env, &f_ptr_args); } free_mstr(env->gwion->mp, tmpl_name); -- 2.43.0