summaryrefslogtreecommitdiff
path: root/src/iterators.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-19 21:57:17 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-19 21:57:17 -0400
commit2694335e54316606ab169e957034ba71e8274144 (patch)
tree6c0c4ab3a4f525b0afee911a674b47abf1bbc324 /src/iterators.cc
parent7fb328707cab288a49bd84c16c2b9eb7a02c5196 (diff)
downloadfork-ledger-2694335e54316606ab169e957034ba71e8274144.tar.gz
fork-ledger-2694335e54316606ab169e957034ba71e8274144.tar.bz2
fork-ledger-2694335e54316606ab169e957034ba71e8274144.zip
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.
Diffstat (limited to 'src/iterators.cc')
-rw-r--r--src/iterators.cc7
1 files changed, 7 insertions, 0 deletions
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<account_t>(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)