fix(linkedlist_queue.c): Remove redundant conditional judgments. (#1055)

This commit is contained in:
gonglja 2024-01-23 22:09:45 +08:00 committed by GitHub
parent 504c6b0568
commit e69f60c07c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);