From f741c1b62e2fa4ac78fa1034d3a8a7fdad909c0c Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 28 Feb 2006 04:05:48 +0000 Subject: [PATCH] *** empty log message *** --- balance.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/balance.cc b/balance.cc index 71808ce4..c3fec87c 100644 --- a/balance.cc +++ b/balance.cc @@ -99,10 +99,12 @@ void balance_t::write(std::ostream& out, balance_t& balance_t::operator*=(const balance_t& bal) { - if (! *this || ! bal) + if (! *this || ! bal) { return (*this = 0L); - else if (amounts.size() == 1 && bal.amounts.size() == 1) + } + else if (amounts.size() == 1 && bal.amounts.size() == 1) { return *this *= (*bal.amounts.begin()).second; + } else { std::string msg; std::ostringstream errmsg(msg); @@ -163,10 +165,8 @@ balance_pair_t& balance_pair_t::operator/=(const balance_pair_t& bal_pair) if (cost) *cost /= bal_pair.cost ? *bal_pair.cost : bal_pair.quantity; - if (bal_pair.price && *bal_pair.price) { - if (price) + if (bal_pair.price && *bal_pair.price && price) *price /= *bal_pair.price; - } return *this; }