aboutsummaryrefslogtreecommitdiff
path: root/src/util/container_heap.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-12-23 20:13:52 +0000
committerChristian Grothoff <christian@grothoff.org>2009-12-23 20:13:52 +0000
commitd5751131b3774d0282ed86d28e9b192651595a38 (patch)
tree8ad44bef8f56dcf1d2a97d2b5e5571c2fa75beb2 /src/util/container_heap.c
parent0acc583b6e411a5f1ebd6172458baaad992c456e (diff)
downloadgnunet-d5751131b3774d0282ed86d28e9b192651595a38.tar.gz
gnunet-d5751131b3774d0282ed86d28e9b192651595a38.zip
fix
Diffstat (limited to 'src/util/container_heap.c')
-rw-r--r--src/util/container_heap.c4
1 files changed, 3 insertions, 1 deletions
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,
278 struct GNUNET_CONTAINER_HeapNode *parent; 278 struct GNUNET_CONTAINER_HeapNode *parent;
279 279
280 GNUNET_assert (node->parent == NULL); 280 GNUNET_assert (node->parent == NULL);
281 while ( (pos->cost < node->cost) ^ (heap->order == GNUNET_CONTAINER_HEAP_ORDER_MAX) ) 281 while ( (heap->order == GNUNET_CONTAINER_HEAP_ORDER_MAX)
282 ? (pos->cost >= node->cost)
283 : (pos->cost <= node->cost) )
282 { 284 {
283 /* node is descendent of pos */ 285 /* node is descendent of pos */
284 pos->tree_size += (1 + node->tree_size); 286 pos->tree_size += (1 + node->tree_size);