mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
heap invariant INSIST did the wrong thing in the border case
of a heap item and its parent having identical priority
This commit is contained in:
parent
5d1bfe4ce1
commit
34b26adb24
1 changed files with 4 additions and 4 deletions
|
|
@ -48,12 +48,12 @@
|
|||
|
||||
/*
|
||||
* When the heap is in a consistent state, the following invariant
|
||||
* holds true: for every element i > 1, heap_parent(i) has a higher
|
||||
* priority than i.
|
||||
* holds true: for every element i > 1, heap_parent(i) has a priority
|
||||
* higher than or equal to that of i.
|
||||
*/
|
||||
#define HEAPCONDITION(i) ((i) == 1 || \
|
||||
heap->compare(heap->array[heap_parent(i)], \
|
||||
heap->array[(i)]))
|
||||
! heap->compare(heap->array[(i)], \
|
||||
heap->array[heap_parent(i)]))
|
||||
|
||||
struct isc_heap {
|
||||
unsigned int magic;
|
||||
|
|
|
|||
Loading…
Reference in a new issue