httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <jwool...@virginia.edu>
Subject Re: cvs commit: httpd-2.0/modules/experimental cache_pqueue.c cache_pqueue.h
Date Wed, 14 Aug 2002 00:04:31 GMT
On 14 Aug 2002 jwoolley@apache.org wrote:

>    void *cache_pq_pop(cache_pqueue_t *q)
>    {
>   -    void *tmp;
>   -    void *d;
>   -    int i = 1;
>   -    int j;
>   +    void *head;
>
>        if (!q || q->size == 1)
>            return NULL;
>
>   -    d = q->d[1];
>   -    tmp = q->d[--q->size];
>   -    while (i <= q->size / 2) {
>   -        j = 2 * i;
>   -        if (j < q->size && q->pri(q->d[j]) < q->pri(q->d[j
+ 1])) {
>   -            j++;
>   -        }
>   -        if (q->pri(q->d[j]) <= q->pri(tmp)) {
>   -            break;
>   -        }
>   -        q->d[i] = q->d[j];
>   -        q->set(q->d[i], i);
>   -        i = j;
>   -    }
>   -    q->d[i] = tmp;
>   -    q->set(q->d[i], i);
>   -    return d;
>   +    head = q->d[1];
>   +    q->d[1] = q->d[--q->size];
>   +    cache_pq_percolate_down(q, 1);
>   +
>   +    return head;
>    }

Oops!  This part wasn't supposed to go in this commit.  It should be a
valid change, but I haven't tested it yet.  Will do that now.

--Cliff


Mime
View raw message