mirror of
https://github.com/krahets/hello-algo.git
synced 2024-12-24 10:36:29 +08:00
fix(linkedlist_queue.c): Remove redundant conditional judgments. (#1055)
This commit is contained in:
parent
504c6b0568
commit
e69f60c07c
1 changed files with 1 additions and 1 deletions
|
@ -24,7 +24,7 @@ LinkedListQueue *newLinkedListQueue() {
|
|||
/* 析构函数 */
|
||||
void delLinkedListQueue(LinkedListQueue *queue) {
|
||||
// 释放所有节点
|
||||
for (int i = 0; i < queue->queSize && queue->front != NULL; i++) {
|
||||
while (queue->front != NULL) {
|
||||
ListNode *tmp = queue->front;
|
||||
queue->front = queue->front->next;
|
||||
free(tmp);
|
||||
|
|
Loading…
Reference in a new issue