diff --git a/uppsrc/Core/Algo.h b/uppsrc/Core/Algo.h index 7d98e154b..e95d1f659 100644 --- a/uppsrc/Core/Algo.h +++ b/uppsrc/Core/Algo.h @@ -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 struct StableSortLessCmp_ { const Cmp& cmp; bool operator()(const StableSortItem& a, const StableSortItem& 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 void StableSortCmp(T& c) { - StableSort(c.Begin(), c.End(), StdCmp()); + StableSortCmp(c.Begin(), c.End(), StdCmp()); } template