Browse Source

QuickSort: Don't sort a single item, nothing to do

Robin Burchell 6 years ago
parent
commit
23a5ce3319
1 changed files with 1 additions and 1 deletions
  1. 1 1
      AK/QuickSort.h

+ 1 - 1
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;