From c9ee5a4501ae3ac5ae6f6d7968c14bc3682ee355 Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 17 Mar 2016 19:09:03 +0100 Subject: [PATCH] frontend/inp.c, inp_parse_temper(), rewrite linked list insertion --- src/frontend/inp.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/frontend/inp.c b/src/frontend/inp.c index 8e5ce9ac3..ec45f4626 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -1468,7 +1468,6 @@ inp_parse_temper(struct line *card) for (str_ptr = beg_pstr; str_ptr < end_tstr; str_ptr++) *str_ptr = ' '; - modtlistnew->next = NULL; /* create wordlist suitable for com_altermod */ wl_append_word(&wl, &wlend, devmodname); wl_append_word(&wl, &wlend, paramname); @@ -1479,13 +1478,8 @@ inp_parse_temper(struct line *card) modtlistnew->wlend = wlend; /* fill in the linked parse tree list */ - if (modtlist) { - struct pt_temper *modtlisttmp = modtlist; - modtlist = modtlistnew; - modtlist->next = modtlisttmp; - } else { - modtlist = modtlistnew; - } + modtlistnew->next = modtlist; + modtlist = modtlistnew; } } else { /* instance expression with 'temper' */ struct pt_temper *devtlistnew = NULL; @@ -1523,7 +1517,6 @@ inp_parse_temper(struct line *card) for (str_ptr = beg_pstr; str_ptr < end_tstr; str_ptr++) *str_ptr = ' '; - devtlistnew->next = NULL; /* create wordlist suitable for com_altermod */ wl_append_word(&wl, &wlend, devmodname); wl_append_word(&wl, &wlend, paramname); @@ -1534,13 +1527,8 @@ inp_parse_temper(struct line *card) devtlistnew->wlend = wlend; /* fill in the linked parse tree list */ - if (devtlist) { - struct pt_temper *devtlisttmp = devtlist; - devtlist = devtlistnew; - devtlist->next = devtlisttmp; - } else { - devtlist = devtlistnew; - } + devtlistnew->next = devtlist; + devtlist = devtlistnew; } } }