From 5a95487ad70a84dd5d3a93e4a8d8a8d1934512b4 Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 18 Mar 2017 20:10:43 +0100 Subject: [PATCH] inp2m.c, #3/7, simpify, move code down into the for loop --- src/spicelib/parser/inp2m.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/spicelib/parser/inp2m.c b/src/spicelib/parser/inp2m.c index f2c946fb5..bfb919c8b 100644 --- a/src/spicelib/parser/inp2m.c +++ b/src/spicelib/parser/inp2m.c @@ -69,15 +69,11 @@ INP2M(CKTcircuit *ckt, INPtables *tab, card *current) INPgetTok(&line, &name, 1); INPinsert(&name, tab); - INPgetNetTok(&line, &nname[0], 1); - INPgetNetTok(&line, &nname[1], 1); - INPgetNetTok(&line, &nname[2], 1); - INPgetNetTok(&line, &nname[3], 1); - - for (i = 4; ; i++) { + for (i = 0; ; i++) { INPgetNetTok(&line, &nname[i], 1); + if (i >= 4) { txfree(INPgetMod(ckt, nname[i], &thismodel, tab)); /* check if using model binning -- pass in line since need 'l' and 'w' */ @@ -86,6 +82,7 @@ INP2M(CKTcircuit *ckt, INPtables *tab, card *current) if (thismodel) break; + } if (i >= max_i) { LITERR ("could not find a valid modelname"); return;