diff --git a/src/adlist.c b/src/adlist.c index 66d31b168..f031c46e8 100644 --- a/src/adlist.c +++ b/src/adlist.c @@ -126,16 +126,7 @@ list *listAddNodeTail(list *list, void *value) if ((node = zmalloc(sizeof(*node))) == NULL) return NULL; node->value = value; - if (list->len == 0) { - list->head = list->tail = node; - node->prev = node->next = NULL; - } else { - node->prev = list->tail; - node->next = NULL; - list->tail->next = node; - list->tail = node; - } - list->len++; + listLinkNodeTail(list, node); return list; }