summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2005-02-15 03:31:04 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:01 -0400
commit74456d89b52953d95fd2dd9314f3ace4b37556fa (patch)
treed2968ec4471a3ca1137f114ef91a9778ced5353b
parent7a38b49048e140be64c90a571313703e80332c39 (diff)
downloadfork-ledger-74456d89b52953d95fd2dd9314f3ace4b37556fa.tar.gz
fork-ledger-74456d89b52953d95fd2dd9314f3ace4b37556fa.tar.bz2
fork-ledger-74456d89b52953d95fd2dd9314f3ace4b37556fa.zip
(parse_and_report): Rearranged some code for efficiency's sake.
-rw-r--r--main.cc26
1 files changed, 14 insertions, 12 deletions
diff --git a/main.cc b/main.cc
index 6bd1201f..905b276f 100644
--- a/main.cc
+++ b/main.cc
@@ -434,20 +434,22 @@ def vmax(d, val):\n\
else
formatter = base_formatter;
- formatter = chain_xact_handlers(command, formatter, journal.get(),
- journal->master, formatter_ptrs);
-
- if (command == "e")
- walk_transactions(new_entry->transactions, *formatter);
- else if (command == "P" || command == "D")
- walk_commodities(commodity_t::commodities, *formatter);
- else if (command == "w")
+ if (command == "w") {
write_textual_journal(*journal, *arg, *formatter, *out);
- else
- walk_entries(journal->entries, *formatter);
+ } else {
+ formatter = chain_xact_handlers(command, formatter, journal.get(),
+ journal->master, formatter_ptrs);
+
+ if (command == "e")
+ walk_transactions(new_entry->transactions, *formatter);
+ else if (command == "P" || command == "D")
+ walk_commodities(commodity_t::commodities, *formatter);
+ else
+ walk_entries(journal->entries, *formatter);
- if (command != "P" && command != "D")
- formatter->flush();
+ if (command != "P" && command != "D")
+ formatter->flush();
+ }
// If we are generating a reconcile report, determine the final set
// of transactions.