Removed redundant null checks I inserted in some of the new_*_list functions because I missed the initial calloc.
authorKrista Grothoff <krista@pep-project.org>
Mon, 18 Jul 2016 12:45:42 +0200
changeset 909e39e9fec2da0
parent 908 f3dd95d4315f
child 910 b5d0f1e3b9c7
Removed redundant null checks I inserted in some of the new_*_list functions because I missed the initial calloc.
src/identity_list.c
src/stringlist.c
src/stringlist.h
src/stringpair.c
src/stringpair.h
     1.1 --- a/src/identity_list.c	Mon Jul 18 12:42:11 2016 +0200
     1.2 +++ b/src/identity_list.c	Mon Jul 18 12:45:42 2016 +0200
     1.3 @@ -14,7 +14,6 @@
     1.4          return NULL;
     1.5  
     1.6      id_list->ident = ident;
     1.7 -    id_list->next = NULL;
     1.8  
     1.9      return id_list;
    1.10  }
     2.1 --- a/src/stringlist.c	Mon Jul 18 12:42:11 2016 +0200
     2.2 +++ b/src/stringlist.c	Mon Jul 18 12:45:42 2016 +0200
     2.3 @@ -20,8 +20,6 @@
     2.4              return NULL;
     2.5          }
     2.6      }
     2.7 -    
     2.8 -    result->next = NULL; // needed for one-element lists
     2.9  
    2.10      return result;
    2.11  }
     3.1 --- a/src/stringlist.h	Mon Jul 18 12:42:11 2016 +0200
     3.2 +++ b/src/stringlist.h	Mon Jul 18 12:45:42 2016 +0200
     3.3 @@ -24,7 +24,7 @@
     3.4  //  caveat:
     3.5  //      the value is being copied before being added to the list
     3.6  //      the original string is still being owned by the caller
     3.7 -//      the "next" pointer of the returned object is explicitly set to NULL
     3.8 +//      the "next" pointer of the returned object is NULL
     3.9  
    3.10  DYNAMIC_API stringlist_t *new_stringlist(const char *value);
    3.11  
     4.1 --- a/src/stringpair.c	Mon Jul 18 12:42:11 2016 +0200
     4.2 +++ b/src/stringpair.c	Mon Jul 18 12:45:42 2016 +0200
     4.3 @@ -60,8 +60,6 @@
     4.4  
     4.5      if (result && value)
     4.6          result->value = value;
     4.7 -
     4.8 -    result->next = NULL;
     4.9      
    4.10      return result;
    4.11  }
     5.1 --- a/src/stringpair.h	Mon Jul 18 12:42:11 2016 +0200
     5.2 +++ b/src/stringpair.h	Mon Jul 18 12:45:42 2016 +0200
     5.3 @@ -63,7 +63,7 @@
     5.4  //
     5.5  //  caveat:
     5.6  //      the ownership of the value goes to the stringpair_list
     5.7 -//      next pointer explicitly set to NULL
     5.8 +//      next pointer is NULL
     5.9  
    5.10  DYNAMIC_API stringpair_list_t *new_stringpair_list(stringpair_t *value);
    5.11