mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-14 10:20:36 +00:00
QuickSort: Don't sort a single item, nothing to do
This commit is contained in:
parent
eeab2e8bb5
commit
23a5ce3319
Notes:
sideshowbarker
2024-07-19 13:56:45 +09:00
Author: https://github.com/rburchell Commit: https://github.com/SerenityOS/serenity/commit/23a5ce3319c Pull-request: https://github.com/SerenityOS/serenity/pull/97
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…
Reference in a new issue