]> granicus.if.org Git - apache/commitdiff
this is a maxheap. this function is therefore named backwards. :)
authorCliff Woolley <jwoolley@apache.org>
Tue, 13 Aug 2002 23:49:26 +0000 (23:49 +0000)
committerCliff Woolley <jwoolley@apache.org>
Tue, 13 Aug 2002 23:49:26 +0000 (23:49 +0000)
no functional change.

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

modules/experimental/cache_pqueue.c

index 610f426c8669fc59eb238f9cdf0f8f5a5284dfa7..02dcec5bde0b9c398e978da3534331619fffd78b 100644 (file)
@@ -143,7 +143,7 @@ static void cache_pq_bubble_up(cache_pqueue_t *q, apr_ssize_t i)
     q->set(moving_node, i);
 }
 
-static apr_ssize_t minchild(cache_pqueue_t *q, apr_ssize_t i)
+static apr_ssize_t maxchild(cache_pqueue_t *q, apr_ssize_t i)
 {
     apr_ssize_t child_node = left(i);
 
@@ -165,7 +165,7 @@ static void cache_pq_percolate_down(cache_pqueue_t *q, apr_ssize_t i)
     void *moving_node = q->d[i];
     long moving_pri = q->pri(moving_node);
 
-    while ((child_node = minchild(q, i)) &&
+    while ((child_node = maxchild(q, i)) &&
            (moving_pri < q->pri(q->d[child_node])))
     {
         q->d[i] = q->d[child_node];
@@ -300,13 +300,13 @@ void cache_pq_dump(cache_pqueue_t *q,
 {
     int i;
 
-    fprintf(stdout,"posn\tleft\tright\tparent\tminchild\t...\n");
+    fprintf(stdout,"posn\tleft\tright\tparent\tmaxchild\t...\n");
     for (i = 1; i < q->size ;i++) {
         fprintf(stdout,
                 "%d\t%d\t%d\t%d\t%" APR_SSIZE_T_FMT "\t",
                 i,
                 left(i), right(i), parent(i),
-                minchild(q, i));
+                maxchild(q, i));
         print(out, q->d[i]);
     }
 }