mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:47:47 +00:00
QuickSort: Don't sort a single item, nothing to do
This commit is contained in:
parent
eeab2e8bb5
commit
23a5ce3319
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@ template <typename Iterator, typename LessThan>
|
|||
void quick_sort(Iterator start, Iterator end, LessThan less_than = is_less_than)
|
||||
{
|
||||
int size = end - start;
|
||||
if (size <= 0)
|
||||
if (size <= 1)
|
||||
return;
|
||||
|
||||
int pivot_point = size / 2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue