From 2694335e54316606ab169e957034ba71e8274144 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 19 Feb 2009 21:57:17 -0400 Subject: Simplify account total values before comparison This way, if two account values are BALANCE types containing only a single AMOUNT, then it will do the sorting comparison of the amounts -- since otherwise balances are ignored for the purposes of sorting. --- src/iterators.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/iterators.cc') diff --git a/src/iterators.cc b/src/iterators.cc index a01c4918..835fec9d 100644 --- a/src/iterators.cc +++ b/src/iterators.cc @@ -177,6 +177,13 @@ void sorted_accounts_iterator::sort_accounts(account_t& account, std::stable_sort(deque.begin(), deque.end(), compare_items(sort_cmp)); + +#if defined(DEBUG_ON) + if (SHOW_DEBUG("accounts.sorted")) { + foreach (account_t * account, deque) + DEBUG("accounts.sorted", "Account: " << account->fullname()); + } +#endif } void sorted_accounts_iterator::push_all(account_t& account) -- cgit v1.2.3