summaryrefslogtreecommitdiff
path: root/walk.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2005-07-22 23:02:18 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:16 -0400
commit5fb495858bd2fc3332def31a07e3c6d72e2d001e (patch)
tree605e5f79864e5ef1b7e4ff5f9cf3824be4e22c8f /walk.cc
parentcf83c024d987e913648aa3e3953d80c50f0be3e7 (diff)
downloadfork-ledger-5fb495858bd2fc3332def31a07e3c6d72e2d001e.tar.gz
fork-ledger-5fb495858bd2fc3332def31a07e3c6d72e2d001e.tar.bz2
fork-ledger-5fb495858bd2fc3332def31a07e3c6d72e2d001e.zip
(operator): Rearranged some code and added an assert.
Diffstat (limited to 'walk.cc')
-rw-r--r--walk.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/walk.cc b/walk.cc
index 04038d2f..0b5ec4d8 100644
--- a/walk.cc
+++ b/walk.cc
@@ -109,10 +109,15 @@ void truncate_entries::flush()
void set_account_value::operator()(transaction_t& xact)
{
- add_transaction_to(xact, account_xdata(*xact.account).value);
- account_xdata_(*xact.account).count++;
+ account_t * acct = xact_account(xact);
+ assert(acct);
+
+ account_xdata_t& xdata = account_xdata(*acct);
+ add_transaction_to(xact, xdata.value);
+
+ xdata.count++;
if (xact.flags & TRANSACTION_VIRTUAL)
- account_xdata_(*xact.account).virtuals++;
+ xdata.virtuals++;
item_handler<transaction_t>::operator()(xact);
}