Fix conditional in heapq function.

This commit is contained in:
Moinak Ghosh 2012-09-11 21:59:08 +05:30
parent f3f472b860
commit a6b3719d89

View file

@ -131,7 +131,7 @@ _siftupmax_s(heap_t *h, __TYPE spos)
/* Set childpos to index of smaller child. */ /* Set childpos to index of smaller child. */
rightpos = childpos + 1; rightpos = childpos + 1;
if (rightpos < endpos) { if (rightpos < endpos) {
if (! (heap[rightpos] < heap[childpos])) if (heap[rightpos] < heap[childpos])
childpos = rightpos; childpos = rightpos;
} }
/* Move the smaller child up. */ /* Move the smaller child up. */