summaryrefslogtreecommitdiff
path: root/walk.cc
diff options
context:
space:
mode:
Diffstat (limited to 'walk.cc')
-rw-r--r--walk.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/walk.cc b/walk.cc
index a13ba06c..ce7ddd8a 100644
--- a/walk.cc
+++ b/walk.cc
@@ -20,8 +20,12 @@ void sort_transactions::flush()
void calc_transactions::operator()(transaction_t * xact)
{
- if (last_xact)
+ if (last_xact) {
xact->total += last_xact->total;
+ xact->index = last_xact->index + 1;
+ } else {
+ xact->index = 0;
+ }
if (inverted) {
xact->amount.negate();
@@ -29,7 +33,6 @@ void calc_transactions::operator()(transaction_t * xact)
}
xact->total += *xact;
- xact->index = last_xact ? last_xact->index + 1 : 0;
(*handler)(xact);