避免elem的next不为空导致的插入一个链表而非结点

This commit is contained in:
思也 2019-11-02 15:14:51 +08:00
parent e0e4e68e6e
commit 16ed6a71e7

View File

@ -31,7 +31,6 @@ void insert(struct single_list **prev, struct single_list *elem)
if (!prev) if (!prev)
return; return;
if (*prev)
elem->next = *prev; elem->next = *prev;
*prev = elem; *prev = elem;
} }