Inline remapping function.
Easier to read, clearer what's going on.
@@ -513,15 +513,17 @@ tysearch(Type *t)
return t;
}
+/* Look up the best type to date in the unification table, returning it */
static Type *
-remapping(Type *t)
+tylookup(Type *t)
{
- Stab *ns;
Type *lu;
+ Stab *ns;
- if (t->type != Tyunres)
- return NULL;
-
+ assert(t != NULL);
+ lu = NULL;
+ while (1) {
+ if (!tytab[t->tid] && t->type == Tyunres) {
ns = curstab();
if (t->name->name.ns)
ns = getns(file, t->name->name.ns);
@@ -530,20 +532,6 @@ remapping(Type *t)
lu = gettype(ns, t->name);
if (!lu)
fatal(t->name, "no type %s", tystr(t));
- return lu;
-}
-
-/* Look up the best type to date in the unification table, returning it */
-static Type *
-tylookup(Type *t)
-{
- Type *lu;
-
- assert(t != NULL);
- lu = NULL;
- while (1) {
- if (!tytab[t->tid]) {
- lu = remapping(t);
if (lu && lu != t)
tytab[t->tid] = lu;
}
