mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
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:
parent
349caecc18
commit
2be45c1ccf
|
|
@ -113,8 +113,7 @@ 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);
|
||||
swap(*(start + pivot_point), *start);
|
||||
|
||||
auto&& pivot = *start;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user