.cosmetics

git-svn-id: svn://ultimatepp.org/upp/trunk@15967 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2021-05-27 08:03:51 +00:00
parent 5af5f3c25c
commit f6202a14df

View file

@ -109,13 +109,13 @@ void Sort__(I l, I h, const Less& less)
case 6: OrderIter6__(l, l + 1, l + 2, l + 3, l + 4, l + 5, less); return;
case 7: OrderIter7__(l, l + 1, l + 2, l + 3, l + 4, l + 5, l + 6, less); return;
}
if(count > 1000) {
if(count > 1000) { // median of 5, 2 of them random elements
middle = l + (count >> 1); // iterators cannot point to the same object!
I q = l + 1 + (int)Random((count >> 1) - 2);
I w = middle + 1 + (int)Random((count >> 1) - 2);
OrderIter5__(l, q, middle, w, h - 1, less);
}
else
else // median of 3
OrderIter3__(l, middle, h - 1, less);
I pivot = h - 2;