]> granicus.if.org Git - neomutt/commitdiff
Remove useless assignments in add_to_list functions.
authorKevin McCarthy <kevin@8t8.us>
Mon, 22 Jan 2018 03:41:47 +0000 (19:41 -0800)
committerRichard Russon <rich@flatcap.org>
Tue, 20 Feb 2018 22:04:56 +0000 (22:04 +0000)
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.

mutt/regex.c

index 8b8ef520e9cb3431d3b7eb60cfab1f911ae04603..0ba3cc05f15f0116d176e58edd237d1b8f5c32f6 100644 (file)
@@ -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);