From 23a5ce3319c2bce6f27693f9b091d43f885d4ffb Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Sun, 26 May 2019 01:41:48 +0200 Subject: [PATCH] QuickSort: Don't sort a single item, nothing to do --- AK/QuickSort.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/QuickSort.h b/AK/QuickSort.h index 01834c6f8a5..790c25786c3 100644 --- a/AK/QuickSort.h +++ b/AK/QuickSort.h @@ -12,7 +12,7 @@ template 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;