diff options
author | Robin Burchell <robin+git@viroteck.net> | 2019-05-26 01:41:48 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-05-26 01:47:41 +0200 |
commit | 23a5ce3319c2bce6f27693f9b091d43f885d4ffb (patch) | |
tree | 3ed812493b04400cf8c898f1de46195aca189cab /AK | |
parent | eeab2e8bb5e7937dded9156d30782aeb924adcab (diff) | |
download | serenity-23a5ce3319c2bce6f27693f9b091d43f885d4ffb.zip |
QuickSort: Don't sort a single item, nothing to do
Diffstat (limited to 'AK')
-rw-r--r-- | AK/QuickSort.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/AK/QuickSort.h b/AK/QuickSort.h index 01834c6f8a..790c25786c 100644 --- a/AK/QuickSort.h +++ b/AK/QuickSort.h @@ -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; |