FastLED 3.9.15
Loading...
Searching...
No Matches

◆ sift_down()

template<typename Iterator, typename Compare>
void fl::sift_down ( Iterator first,
Iterator last,
Iterator start,
Compare comp )

Definition at line 10 of file priority_queue.h.

10 {
11 auto root = start;
12 auto child = first + 2 * (root - first) + 1;
13
14 while (child < last) {
15 if (child + 1 < last && comp(*child, *(child + 1))) {
16 ++child;
17 }
18
19 if (comp(*root, *child)) {
20 auto tmp = *root;
21 *root = *child;
22 *child = tmp;
23
24 root = child;
25 child = first + 2 * (root - first) + 1;
26 } else {
27 break;
28 }
29 }
30}

Referenced by pop_heap().

+ Here is the caller graph for this function: