[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;
|
return;
|
||||||
|
|
||||||
bool has_right = right < heap.length;
|
bool has_right = right < heap.length;
|
||||||
if (heap[index] <= heap[left]
|
if (heap[index].second <= heap[left].second
|
||||||
&& (!has_right || heap[index] <= heap[right]))
|
&& (!has_right || heap[index].second <= heap[right].second))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!has_right || heap[left] < heap[right])
|
if (!has_right || heap[left].second < heap[right].second)
|
||||||
{
|
{
|
||||||
swap (index, left);
|
swap (index, left);
|
||||||
bubble_down (left);
|
bubble_down (left);
|
||||||
|
|
Loading…
Reference in New Issue