diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-11-08 21:31:27 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-11-08 21:31:27 +0000 |
commit | 024450ec8ac7d00b5c7c830d34ee1843b6c3a753 (patch) | |
tree | f5f8e91f837474ef4bca22f91672a3b14a606787 /src/util/container_heap.c | |
parent | bb82fb7f4ea781b843f032c6869f98e6fa6fa107 (diff) | |
download | gnunet-024450ec8ac7d00b5c7c830d34ee1843b6c3a753.tar.gz gnunet-024450ec8ac7d00b5c7c830d34ee1843b6c3a753.zip |
indenting
Diffstat (limited to 'src/util/container_heap.c')
-rw-r--r-- | src/util/container_heap.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/util/container_heap.c b/src/util/container_heap.c index 9a2afaebc..cde678257 100644 --- a/src/util/container_heap.c +++ b/src/util/container_heap.c | |||
@@ -392,9 +392,7 @@ GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *root) | |||
392 | struct GNUNET_CONTAINER_heap_node *root_node; | 392 | struct GNUNET_CONTAINER_heap_node *root_node; |
393 | struct GNUNET_CONTAINER_heap_node *last; | 393 | struct GNUNET_CONTAINER_heap_node *last; |
394 | 394 | ||
395 | if ( (root == NULL) || | 395 | if ((root == NULL) || (root->size == 0) || (root->root == NULL)) |
396 | (root->size == 0) || | ||
397 | (root->root == NULL) ) | ||
398 | { | 396 | { |
399 | GNUNET_break (0); | 397 | GNUNET_break (0); |
400 | return NULL; | 398 | return NULL; |
@@ -404,7 +402,7 @@ GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *root) | |||
404 | ret = root_node->element; | 402 | ret = root_node->element; |
405 | last = getPos (root, root->size); | 403 | last = getPos (root, root->size); |
406 | 404 | ||
407 | if ( (root_node == last) && (root->size == 1)) | 405 | if ((root_node == last) && (root->size == 1)) |
408 | { | 406 | { |
409 | /* We are removing the last node in the heap! */ | 407 | /* We are removing the last node in the heap! */ |
410 | GNUNET_free (last); | 408 | GNUNET_free (last); |
@@ -423,7 +421,7 @@ GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *root) | |||
423 | root_node->cost = last->cost; | 421 | root_node->cost = last->cost; |
424 | 422 | ||
425 | if (root->traversal_pos == last) | 423 | if (root->traversal_pos == last) |
426 | root->traversal_pos = root->root; | 424 | root->traversal_pos = root->root; |
427 | GNUNET_free (last); | 425 | GNUNET_free (last); |
428 | root->size--; | 426 | root->size--; |
429 | percolateDownHeap (root->root, root); | 427 | percolateDownHeap (root->root, root); |