summaryrefslogtreecommitdiff
path: root/main.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-11 23:24:49 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-11 23:24:49 -0400
commitc6f19a98d3a0af82508258765a635a7269667ba0 (patch)
treedf3efc76ed29eb1fad4b9d1afbf2a0e19fe42b3c /main.cc
parent0cf1d8fe695ce570b9171c9e0eae6701a09b610b (diff)
downloadfork-ledger-c6f19a98d3a0af82508258765a635a7269667ba0.tar.gz
fork-ledger-c6f19a98d3a0af82508258765a635a7269667ba0.tar.bz2
fork-ledger-c6f19a98d3a0af82508258765a635a7269667ba0.zip
cleanup
Diffstat (limited to 'main.cc')
-rw-r--r--main.cc23
1 files changed, 11 insertions, 12 deletions
diff --git a/main.cc b/main.cc
index 2e5d9125..7f4c914e 100644
--- a/main.cc
+++ b/main.cc
@@ -590,18 +590,14 @@ int main(int argc, char * argv[])
if (command == "b") {
std::auto_ptr<item_handler<transaction_t> > formatter;
-
formatter.reset(new add_to_account_value);
if (show_related)
formatter.reset(new related_transactions(formatter.release(),
show_all_related));
- formatter.reset(new filter_transactions(formatter.release(),
- predicate));
-
+ formatter.reset(new filter_transactions(formatter.release(), predicate));
walk_entries(journal->entries, *formatter.get());
format_account acct_formatter(std::cout, format, display_predicate);
-
if (show_subtotals)
sum_accounts(journal->master);
walk_accounts(journal->master, acct_formatter, sort_order.get());
@@ -613,11 +609,12 @@ int main(int argc, char * argv[])
}
}
else if (command == "E") {
- add_to_account_value formatter;
- walk_entries(journal->entries, formatter);
+ std::auto_ptr<item_handler<transaction_t> > formatter;
+ formatter.reset(new add_to_account_value);
+ formatter.reset(new filter_transactions(formatter.release(), predicate));
+ walk_entries(journal->entries, *formatter.get());
- format_equity acct_formatter(std::cout, format, nformat,
- display_predicate);
+ format_equity acct_formatter(std::cout, format, nformat, display_predicate);
sum_accounts(journal->master);
walk_accounts(journal->master, acct_formatter, sort_order.get());
}
@@ -693,12 +690,14 @@ int main(int argc, char * argv[])
// Once the filters are chained, walk `journal's entries and start
// feeding each transaction that matches `predicate' to the chain.
- walk_entries(journal->entries.begin(), journal->entries.end(),
- *formatter.get());
+ walk_entries(journal->entries, *formatter.get());
#ifdef DEBUG_ENABLED
+ // The transaction display flags (dflags) are not recorded in the
+ // binary cache, and only need to be cleared if the transactions
+ // are to be displayed a second time.
clear_display_flags cleanup;
- walk_entries(journal->entries.begin(), journal->entries.end(), cleanup);
+ walk_entries(journal->entries, cleanup);
#endif
}