Unverified Commit c95ff0f3 authored by 王卿's avatar 王卿 Committed by GitHub
Browse files

Remove duplicate code in listAddNodeTail (#11733)

Remove duplicate code that removes a node from the tail of a list.
parent f3f6f7c0
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment