AK: Remove redundant condition from Quick Sort

if (size <= 1)
       return;
This means that size is at the very minimum 2,
and pivot_point at the very minimum equals 1 as size / 2;
The condition if (pivot_point) can never be false.
This commit is contained in:
Pavel Shliak 2024-12-20 01:47:29 +04:00 committed by Andreas Kling
parent 349caecc18
commit 2be45c1ccf
Notes: github-actions[bot] 2024-12-22 11:35:14 +00:00

View file

@ -113,7 +113,6 @@ void single_pivot_quick_sort(Iterator start, Iterator end, LessThan less_than)
return;
int pivot_point = size / 2;
if (pivot_point)
swap(*(start + pivot_point), *start);
auto&& pivot = *start;