From dc092c4ebc446a88dce856369f099a68f4004544 Mon Sep 17 00:00:00 2001 From: rlar Date: Wed, 22 Mar 2017 20:52:10 +0100 Subject: [PATCH] subckt.c, finishLine(), #8/9, fuse two if's with the same conditional expr --- src/frontend/subckt.c | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/src/frontend/subckt.c b/src/frontend/subckt.c index 7a0a1827e..88489f07b 100644 --- a/src/frontend/subckt.c +++ b/src/frontend/subckt.c @@ -1330,26 +1330,7 @@ finishLine(struct bxx_buffer *t, char *src, char *scname) bxx_putc(t, '.'); bxx_put_substring(t, buf, buf_end); } - } else { - /* - i(vname) -> i(v.subckt.vname) - i(ename) -> i(e.subckt.ename) - i(hname) -> i(h.subckt.hname) - i(bname) -> i(b.subckt.hname) - */ - if (buf[0] == 'v' || buf[0] == 'V' || buf[0] == 'e' || buf[0] == 'h' - || buf[0] == 'b' || buf[0] == 'B') { - bxx_putc(t, buf[0]); - bxx_putc(t, '.'); - } - bxx_put_cstring(t, scname); - bxx_putc(t, '.'); - bxx_put_substring(t, buf, buf_end); - } - - /* translate the reference node, as in the "2" in "v(4,2)" */ - - if ((which == 'v') || (which == 'V')) { + /* translate the reference node, as in the "2" in "v(4,2)" */ while (*src && (isspace_c(*src) || *src == ',')) { src++; } @@ -1366,6 +1347,21 @@ finishLine(struct bxx_buffer *t, char *src, char *scname) bxx_put_substring(t, buf, buf_end); } } + } else { + /* + i(vname) -> i(v.subckt.vname) + i(ename) -> i(e.subckt.ename) + i(hname) -> i(h.subckt.hname) + i(bname) -> i(b.subckt.hname) + */ + if (buf[0] == 'v' || buf[0] == 'V' || buf[0] == 'e' || buf[0] == 'h' + || buf[0] == 'b' || buf[0] == 'B') { + bxx_putc(t, buf[0]); + bxx_putc(t, '.'); + } + bxx_put_cstring(t, scname); + bxx_putc(t, '.'); + bxx_put_substring(t, buf, buf_end); } } }