MCPcopy Create free account
hub / github.com/FastLED/FastLED / quicksort_impl

Function quicksort_impl

src/fl/stl/algorithm.h:411–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409// Quicksort implementation
410template <typename Iterator, typename Compare>
411void quicksort_impl(Iterator first, Iterator last, Compare comp) FL_NOEXCEPT {
412 if (last - first <= 16) { // Use insertion sort for small arrays
413 insertion_sort(first, last, comp);
414 return;
415 }
416
417 Iterator pivot = partition(first, last, comp);
418 quicksort_impl(first, pivot, comp);
419 quicksort_impl(pivot + 1, last, comp);
420}
421
422// Rotate elements in range [first, last) so that middle becomes the new first
423template <typename Iterator>

Callers 1

sortFunction · 0.85

Calls 2

insertion_sortFunction · 0.85
partitionFunction · 0.70

Tested by

no test coverage detected