merge from gcc
This commit is contained in:
parent
4a657b0d92
commit
0dc69033a0
2 changed files with 15 additions and 1 deletions
|
@ -214,7 +214,10 @@ fibheap_replace_key_data (fibheap_t heap, fibnode_t node,
|
|||
node->key = key;
|
||||
y = node->parent;
|
||||
|
||||
if (okey == key)
|
||||
/* Short-circuit if the key is the same, as we then don't have to
|
||||
do anything. Except if we're trying to force the new node to
|
||||
be the new minimum for delete. */
|
||||
if (okey == key && okey != FIBHEAPKEY_MIN)
|
||||
return odata;
|
||||
|
||||
/* These two compares are specifically <= 0 to make sure that in the case
|
||||
|
@ -256,6 +259,11 @@ fibheap_delete_node (fibheap_t heap, fibnode_t node)
|
|||
|
||||
/* To perform delete, we just make it the min key, and extract. */
|
||||
fibheap_replace_key (heap, node, FIBHEAPKEY_MIN);
|
||||
if (node != heap->min)
|
||||
{
|
||||
fprintf (stderr, "Can't force minimum on fibheap.\n");
|
||||
abort ();
|
||||
}
|
||||
fibheap_extract_min (heap);
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue