避免elem的next不为空导致的插入一个链表而非结点
This commit is contained in:
parent
e0e4e68e6e
commit
16ed6a71e7
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user