FastLED 3.10.10
Loading...
Searching...
No Matches

◆ quicksort_impl() [2/2]

template<typename Iterator, typename Compare>
void fl::detail::quicksort_impl ( Iterator first,
Iterator last,
Compare comp,
int depth_limit )

Definition at line 428 of file algorithm.h.

429 {
430 while (last - first > 16) {
431 if (depth_limit <= 0) {
432 detail::heap_sort(first, last, comp);
433 return;
434 }
435 --depth_limit;
436 Iterator lt;
437 Iterator gt;
438 detail::partition3(first, last, comp, lt, gt);
439 if (lt - first < last - gt) {
440 detail::quicksort_impl(first, lt, comp, depth_limit);
441 first = gt;
442 } else {
443 detail::quicksort_impl(gt, last, comp, depth_limit);
444 last = lt;
445 }
446 }
447 insertion_sort(first, last, comp);
448}
void quicksort_impl(Iterator first, Iterator last, Compare comp, int depth_limit) FL_NO_EXCEPT
Definition algorithm.h:428
void heap_sort(Iterator first, Iterator last, Compare comp) FL_NO_EXCEPT
Definition algorithm.h:413
void insertion_sort(Iterator first, Iterator last, Compare comp) FL_NO_EXCEPT
Definition algorithm.h:303
void partition3(Iterator first, Iterator last, Compare comp, Iterator &lt_out, Iterator &gt_out) FL_NO_EXCEPT
Definition algorithm.h:347

References fl::FL_NO_EXCEPT, heap_sort(), insertion_sort(), partition3(), and quicksort_impl().

Referenced by quicksort_impl(), quicksort_impl(), and fl::adl_barrier::sort().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: