Skip to content

Commit 54eaac8

Browse files
committed
Fixed quickSortPartition() return destructuring
1 parent 203d830 commit 54eaac8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/SortAlgorithms.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ static int quickSortHelper(std::vector<Sortable>& parent, SortableIterator beg,
105105
// base case
106106
if (end - beg < 2) return 0;
107107

108-
auto [pivot, numOfComparisons] = quickSortPartition(parent, beg, end, timeSleep);
108+
SortableIterator pivot;
109+
int numOfComparisons;
110+
std::tie(pivot, numOfComparisons) = quickSortPartition(parent, beg, end, timeSleep);
111+
109112
return numOfComparisons +
110113
quickSortHelper(parent, beg, pivot, timeSleep) +
111114
quickSortHelper(parent, pivot + 1, end, timeSleep);

0 commit comments

Comments
 (0)