projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Automatic date update in version.in
[deliverable/binutils-gdb.git]
/
libiberty
/
fibheap.c
diff --git
a/libiberty/fibheap.c
b/libiberty/fibheap.c
index c032149c0c24fc9639d9c56725691e9d4035aed8..1449e7fd3dd85471c86d38eb10742ca24c9c6907 100644
(file)
--- a/
libiberty/fibheap.c
+++ b/
libiberty/fibheap.c
@@
-1,5
+1,5
@@
/* A Fibonacci heap datatype.
/* A Fibonacci heap datatype.
- Copyright
1998, 1999, 2000, 2001
Free Software Foundation, Inc.
+ Copyright
(C) 1998-2019
Free Software Foundation, Inc.
Contributed by Daniel Berlin (dan@cgsoftware.com).
This file is part of GNU CC.
Contributed by Daniel Berlin (dan@cgsoftware.com).
This file is part of GNU CC.
@@
-214,7
+214,10
@@
fibheap_replace_key_data (fibheap_t heap, fibnode_t node,
node->key = key;
y = node->parent;
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
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);
/* 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;
fibheap_extract_min (heap);
return ret;
This page took
0.025729 seconds
and
4
git commands to generate.