[subset] Use priority for comparison in heap.
This commit is contained in:
parent
4c8dd41ed9
commit
59ac0a0d0a
|
@ -111,11 +111,11 @@ struct hb_priority_queue_t
|
|||
return;
|
||||
|
||||
bool has_right = right < heap.length;
|
||||
if (heap[index] <= heap[left]
|
||||
&& (!has_right || heap[index] <= heap[right]))
|
||||
if (heap[index].second <= heap[left].second
|
||||
&& (!has_right || heap[index].second <= heap[right].second))
|
||||
return;
|
||||
|
||||
if (!has_right || heap[left] < heap[right])
|
||||
if (!has_right || heap[left].second < heap[right].second)
|
||||
{
|
||||
swap (index, left);
|
||||
bubble_down (left);
|
||||
|
|
Loading…
Reference in New Issue