[priority-queue] Minor micro-optimize

This commit is contained in:
Behdad Esfahbod 2022-11-23 17:46:32 -07:00
parent f2851e4157
commit a7fee43cef
1 changed files with 1 additions and 1 deletions

View File

@ -114,7 +114,7 @@ struct hb_priority_queue_t
bool has_right = right < heap.length; bool has_right = right < heap.length;
if (heap.arrayZ[index].first <= heap.arrayZ[left].first if (heap.arrayZ[index].first <= heap.arrayZ[left].first
&& (!has_right || heap[index].first <= heap.arrayZ[right].first)) && (!has_right || heap.arrayZ[index].first <= heap.arrayZ[right].first))
return; return;
if (!has_right || heap.arrayZ[left].first < heap.arrayZ[right].first) if (!has_right || heap.arrayZ[left].first < heap.arrayZ[right].first)