From: Christian Grothoff Date: Wed, 23 Dec 2009 20:13:52 +0000 (+0000) Subject: fix X-Git-Tag: initial-import-from-subversion-38251~22996 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d5751131b3774d0282ed86d28e9b192651595a38;p=oweals%2Fgnunet.git fix --- diff --git a/src/util/container_heap.c b/src/util/container_heap.c index dbb391ac4..1bb7d5790 100644 --- a/src/util/container_heap.c +++ b/src/util/container_heap.c @@ -278,7 +278,9 @@ insert_node (struct GNUNET_CONTAINER_Heap *heap, struct GNUNET_CONTAINER_HeapNode *parent; GNUNET_assert (node->parent == NULL); - while ( (pos->cost < node->cost) ^ (heap->order == GNUNET_CONTAINER_HEAP_ORDER_MAX) ) + while ( (heap->order == GNUNET_CONTAINER_HEAP_ORDER_MAX) + ? (pos->cost >= node->cost) + : (pos->cost <= node->cost) ) { /* node is descendent of pos */ pos->tree_size += (1 + node->tree_size);