ref: 3b14d1fdbe9a35efba9789ac4e384a4d50d4dbeb
parent: dd155881cf69b09d8e33ad2f4d6ef5a96eaa097c
author: mkf <mkf@cloud9p.org>
date: Wed Dec 11 07:45:56 EST 2024
util.c: remove unused variable
--- a/util.c
+++ b/util.c
@@ -257,7 +257,7 @@
void
qdel(Quene *q, List *item)
{
- List *prev = nil, *next = nil;
+ List *prev = nil, *next;
if(q->len == 0 || item == nil
|| q->head == nil || q->tail == nil)
@@ -265,23 +265,21 @@
/* we can't use lldel, because we can't update q->tail if l == q->tail */
- for(List *t = q->head;
- t->next != nil && t != t->next;
- t = t->next)
+ for(List *t = q->head ; t->next != nil && t != t->next ; t = t->next)
{
/* maybe we should use memcmp */
if(t == item)
{
- next = t->next;
+ next = t->next;
- /* these may be nil and that's fine */
- if(item == q->head)
- q->head = q->head->next;
- if(item == q->tail)
- q->tail = q->tail->next;
+ /* these may be nil and that's fine */
+ if(item == q->head)
+ q->head = q->head->next;
+ if(item == q->tail)
+ q->tail = q->tail->next;
- if(prev != nil)
- prev->next = next;
+ if(prev != nil)
+ prev->next = next;
}
prev = t;