From 000bfe1cece3ecbfee8f07a46d1f0b000dbbc983 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 21 Aug 2004 15:55:03 -0400 Subject: only compute the cost when it differs from the amount --- walk.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'walk.cc') diff --git a/walk.cc b/walk.cc index 7422aad3..00e4213f 100644 --- a/walk.cc +++ b/walk.cc @@ -29,7 +29,8 @@ void calc_transactions::operator()(transaction_t * xact) if (inverted) { xact->amount.negate(); - xact->cost.negate(); + if (xact->cost) + xact->cost->negate(); } if (! (xact->dflags & TRANSACTION_NO_TOTAL)) @@ -39,7 +40,8 @@ void calc_transactions::operator()(transaction_t * xact) if (inverted) { xact->amount.negate(); - xact->cost.negate(); + if (xact->cost) + xact->cost->negate(); } last_xact = xact; @@ -64,7 +66,6 @@ void collapse_transactions::report_cumulative_subtotal() total_xact->entry = last_entry; total_xact->amount = (*i).second; - total_xact->cost = (*i).second; (*handler)(total_xact); } @@ -161,7 +162,6 @@ void subtotal_transactions::flush(const char * spec_fmt) xact->entry = entry; xact->amount = (*j).second; - xact->cost = (*j).second; (*handler)(xact); } -- cgit v1.2.3