Skip to content

Commit

Permalink
Put the minlen condition back in quicksort
Browse files Browse the repository at this point in the history
It was accidentally removed in PR chapel-lang#15239.

---
Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
  • Loading branch information
mppf committed Feb 26, 2021
1 parent 04a721a commit 0bded7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/packages/Sort.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -1238,7 +1238,7 @@ module QuickSort {
mid = lo + (hi-lo+1)/2;
var piv = mid;

if hi - lo < 0 { // minlen {
if hi - lo < minlen {
// base case -- use insertion sort
InsertionSort.insertionSortMoveElts(Data, comparator=comparator, lo, hi);
return;
Expand Down

0 comments on commit 0bded7a

Please sign in to comment.