From a794aa24213a8d71ef67d3b686c0b7f8b1615346 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Tue, 5 Nov 2019 20:27:44 +0100 Subject: [PATCH] :art: Clean env_utils --- src/oo/env_utils.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/oo/env_utils.c b/src/oo/env_utils.c index caa3a4d2..7bec6eb5 100644 --- a/src/oo/env_utils.c +++ b/src/oo/env_utils.c @@ -34,16 +34,20 @@ ANN m_bool env_storage(const Env env, ae_flag flag, const loc_t pos) { return !(env->class_def && GET(flag, ae_flag_global)) ? GW_OK :GW_ERROR; } -ANN Type find_type(const Env env, ID_List path) { - Type type = nspc_lookup_type1(env->curr, path->xid); -if(!type && env->class_def) { - Type base = env->class_def->e->parent; - while(base && base->nspc) { - if((type = nspc_lookup_type1(base->nspc, path->xid))) - break; +ANN Type _find_type(const Env env, const Symbol xid) { + Type type = nspc_lookup_type1(env->curr, xid); + if(!type && env->class_def) { + Type base = env->class_def->e->parent; + while(base && base->nspc) { + if((type = nspc_lookup_type1(base->nspc, xid))) + break; + } } + return type; } +ANN Type find_type(const Env env, ID_List path) { + Type type = _find_type(env, path->xid); CHECK_OO(type) Nspc nspc = type->nspc; path = path->next; -- 2.43.0