From 74145c53a6e22454f2521754472e02f3f4cad0ae Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 18 Mar 2017 19:42:55 +0100 Subject: [PATCH] inp2m.c, #4/7, move code up into the for loop --- src/spicelib/parser/inp2m.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/spicelib/parser/inp2m.c b/src/spicelib/parser/inp2m.c index bfb919c8b..84f41d928 100644 --- a/src/spicelib/parser/inp2m.c +++ b/src/spicelib/parser/inp2m.c @@ -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") &&