inp2m.c, #4/7, move code up into the for loop

This commit is contained in:
rlar 2017-03-18 19:42:55 +01:00
parent 5a95487ad7
commit 74145c53a6
1 changed files with 5 additions and 7 deletions

View File

@ -80,13 +80,17 @@ INP2M(CKTcircuit *ckt, INPtables *tab, card *current)
if (!thismodel)
txfree(INPgetModBin(ckt, nname[i], &thismodel, tab, line));
if (thismodel)
if (thismodel) {
model = nname[i];
INPinsert(&model, tab);
break;
}
}
if (i >= max_i) {
LITERR ("could not find a valid modelname");
return;
}
INPtermInsert(ckt, &nname[i], tab, &node[i]);
}
numnodes = i;
@ -96,12 +100,6 @@ INP2M(CKTcircuit *ckt, INPtables *tab, card *current)
return;
}
for (i = 0; i < numnodes; i++)
INPtermInsert(ckt, &nname[i], tab, &node[i]);
model = nname[numnodes];
INPinsert(&model, tab);
if (thismodel->INPmodType != INPtypelook("Mos1") &&
thismodel->INPmodType != INPtypelook("Mos2") &&
thismodel->INPmodType != INPtypelook("Mos3") &&