Enhancement

- Corrected sorting to use std::stable_sort instead of std::sort, which is not
  guaranteed stable (thanks to Stefan Hacker).
This commit is contained in:
Paul Beckingham 2011-03-09 12:45:45 -05:00
parent 954db75b37
commit 96d406960d
3 changed files with 4 additions and 1 deletions

View file

@ -79,4 +79,5 @@ suggestions:
Patrick R McDonald
Pete Lewis
Bryce Harrington
Stefan Hacker

View file

@ -3,6 +3,8 @@
2.0.0 ()
+ autoconf eliminated.
+ Corrected sorting to use std::stable_sort instead of std::sort, which is not
guaranteed stable (thanks to Stefan Hacker).
------ old releases ------------------------------

View file

@ -829,7 +829,7 @@ const std::string Table::render (int maxrows /* = 0 */, int maxlines /* = 0 */)
if (mSortColumns.size ())
{
table = this; // Substitute for 'this' in the static 'sort_compare'.
std::sort (order.begin (), order.end (), sort_compare);
std::stable_sort (order.begin (), order.end (), sort_compare);
}
}