From: Kevin McCarthy Date: Mon, 22 Jan 2018 03:41:47 +0000 (-0800) Subject: Remove useless assignments in add_to_list functions. X-Git-Tag: neomutt-20180223~3^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f679b1ee99c5204f3d4def22e13664f21b025d99;p=neomutt Remove useless assignments in add_to_list functions. The code was probably pulled from some of the header processing functions, which were in a loop. In those versions, "last" pointed to a collection of new entries appended, but in these two functions, updating last just obfuscates the code. --- diff --git a/mutt/regex.c b/mutt/regex.c index 8b8ef520e..0ba3cc05f 100644 --- a/mutt/regex.c +++ b/mutt/regex.c @@ -175,12 +175,9 @@ int mutt_regexlist_add(struct RegexList **rl, const char *str, int flags, struct t = mutt_regexlist_new(); t->regex = rx; if (last) - { last->next = t; - last = last->next; - } else - *rl = last = t; + *rl = t; } else /* duplicate */ mutt_regex_free(&rx);