]> git.wh0rd.org Git - nano.git/commitdiff
Eliding the now too tiny function free_list_item().
authorBenno Schulenberg <bensberg@justemail.net>
Fri, 4 Mar 2016 18:28:03 +0000 (18:28 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Fri, 4 Mar 2016 18:28:03 +0000 (18:28 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5708 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/global.c

index 6d44519fe3d46c5a69e1852de8aae6cc41b61d80..8b75a2229af43a0860342839fde74be4d4941f61 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
        regular expression when it matched -- drop this tiny optimization
        for when opening multiple files.  Instead stop calling malloc().
        * src/nano.h: Delete a now-unused struct member.
+       * src/global.c (free_list_item): Elide this now too tiny function.
 
 2016-03-01  Benno Schulenberg  <bensberg@justemail.net>
        * src/rcfile.c (parse_syntax), src/color.c (color_update): Don't
index 35c91ad69cfac99ccd6cc94932140fbce2170f7f..6c962653a05234ca802e6bb5829c31af240b7285 100644 (file)
@@ -1623,14 +1623,6 @@ int strtomenu(const char *input)
 
 
 #ifdef DEBUG
-#ifndef DISABLE_COLOR
-void free_list_item(regexlisttype *dropit)
-{
-    free(dropit->full_regex);
-    free(dropit);
-}
-#endif
-
 /* This function is used to gracefully return all the memory we've used.
  * It should be called just before calling exit().  Practically, the
  * only effect is to cause a segmentation fault if the various data
@@ -1684,17 +1676,20 @@ void thanks_for_all_the_fish(void)
        while (syntaxes->extensions != NULL) {
            regexlisttype *bob = syntaxes->extensions;
            syntaxes->extensions = bob->next;
-           free_list_item(bob);
+           free(bob->full_regex);
+           free(bob);
        }
        while (syntaxes->headers != NULL) {
            regexlisttype *bob = syntaxes->headers;
            syntaxes->headers = bob->next;
-           free_list_item(bob);
+           free(bob->full_regex);
+           free(bob);
        }
        while (syntaxes->magics != NULL) {
            regexlisttype *bob = syntaxes->magics;
            syntaxes->magics = bob->next;
-           free_list_item(bob);
+           free(bob->full_regex);
+           free(bob);
        }
 
        while (syntaxes->color != NULL) {