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

◆ mergesort_impl()

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

Definition at line 571 of file algorithm.h.

571 {
572 auto size = last - first;
573 if (size <= 16) { // Use insertion sort for small arrays (it's stable)
574 insertion_sort(first, last, comp);
575 return;
576 }
577
578 Iterator middle = first + size / 2;
579 mergesort_impl(first, middle, comp);
580 mergesort_impl(middle, last, comp);
581 merge_inplace(first, middle, last, comp);
582}
void mergesort_impl(Iterator first, Iterator last, Compare comp) FL_NO_EXCEPT
Definition algorithm.h:571
void insertion_sort(Iterator first, Iterator last, Compare comp) FL_NO_EXCEPT
Definition algorithm.h:303
void merge_inplace(Iterator first, Iterator middle, Iterator last, Compare comp) FL_NO_EXCEPT
Definition algorithm.h:496

References fl::FL_NO_EXCEPT, insertion_sort(), merge_inplace(), and mergesort_impl().

Referenced by mergesort_impl(), and fl::adl_barrier::stable_sort().

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