*Core: Fix of StableSortCmp typo

git-svn-id: svn://ultimatepp.org/upp/trunk@5248 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2012-08-03 17:15:53 +00:00
parent 8fc083443a
commit 3fa468ca8d

View file

@ -812,7 +812,7 @@ void Sort(I l, I h, const Less& less)
int pass = 5;
for(;;) {
I middle = l + (count >> 1); // get the middle element
OrderIter2__(l, middle, less); // sort l, middle, h-1
OrderIter2__(l, middle, less); // sort l, middle, h-1 to find median of 3
OrderIter2__(middle, h - 1, less);
OrderIter2__(l, middle, less); // median is now in middle
IterSwap(l + 1, middle); // move median pivot to l + 1
@ -931,7 +931,7 @@ template <class T, class Cmp>
struct StableSortLessCmp_ {
const Cmp& cmp;
bool operator()(const StableSortItem<T>& a, const StableSortItem<T>& b) const {
int q = SgnCompare(a.value, b.value);
int q = cmp(a.value, b.value);
return q ? q < 0 : a.index < b.index;
}
@ -973,7 +973,7 @@ struct StdCmp {
template <class T>
void StableSortCmp(T& c)
{
StableSort(c.Begin(), c.End(), StdCmp<typename T::ValueType>());
StableSortCmp(c.Begin(), c.End(), StdCmp<typename T::ValueType>());
}
template <class II, class VI, class K>