summaryrefslogtreecommitdiff
path: root/walk.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-21 15:55:03 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-21 15:55:03 -0400
commit000bfe1cece3ecbfee8f07a46d1f0b000dbbc983 (patch)
tree6d2c666097900fff421da6a57b41f0a7c43a39b7 /walk.h
parent225acd14e57a0a476ce022a7c5703a8f1cee34ef (diff)
downloadfork-ledger-000bfe1cece3ecbfee8f07a46d1f0b000dbbc983.tar.gz
fork-ledger-000bfe1cece3ecbfee8f07a46d1f0b000dbbc983.tar.bz2
fork-ledger-000bfe1cece3ecbfee8f07a46d1f0b000dbbc983.zip
only compute the cost when it differs from the amount
Diffstat (limited to 'walk.h')
-rw-r--r--walk.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/walk.h b/walk.h
index 41b0d456..6cac857f 100644
--- a/walk.h
+++ b/walk.h
@@ -121,7 +121,7 @@ class set_account_value : public item_handler<transaction_t>
virtual void operator()(transaction_t * xact) {
xact->account->value += *xact;
- xact->account->count++;
+ xact->account->subcount++;
if (handler)
(*handler)(xact);
@@ -364,9 +364,10 @@ inline void sum_accounts(account_t * account) {
i++) {
sum_accounts((*i).second);
account->total += (*i).second->total;
- account->count += (*i).second->count;
+ account->count += (*i).second->count + (*i).second->subcount;
}
account->total += account->value;
+ account->count += account->subcount;
}
typedef std::deque<account_t *> accounts_deque;