From 0c8dff61edf2db560c92c25468520cd1bc773d77 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 13 Aug 2004 17:29:46 -0400 Subject: fixed problem with writing binary amounts --- walk.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'walk.cc') 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); -- cgit v1.2.3