]> granicus.if.org Git - apache/commitdiff
on second thought, it actually *is* possible for this to bubble up rather
authorCliff Woolley <jwoolley@apache.org>
Wed, 14 Aug 2002 01:24:16 +0000 (01:24 +0000)
committerCliff Woolley <jwoolley@apache.org>
Wed, 14 Aug 2002 01:24:16 +0000 (01:24 +0000)
than down, strange as that may seem.  this function still needs further
testing, but this is better than what was there a minute ago.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96372 13f79535-47bb-0310-9956-ffa450edef68

modules/experimental/cache_pqueue.c

index 144e7c65c5b87604e45979756b504817a55525c0..5ded1907979eef2651cadb52d1506f9f27100576 100644 (file)
@@ -223,7 +223,10 @@ apr_status_t cache_pq_remove(cache_pqueue_t *q, void *d)
 {
     apr_ssize_t posn = q->get(d);
     q->d[posn] = q->d[--q->size];
-    cache_pq_percolate_down(q, posn);
+    if (q->pri(q->d[posn]) > q->pri(d))
+        cache_pq_bubble_up(q, posn);
+    else
+        cache_pq_percolate_down(q, posn);
 
     return APR_SUCCESS;
 }