*** empty log message ***
This commit is contained in:
parent
73b9d060c0
commit
f741c1b62e
1 changed files with 5 additions and 5 deletions
10
balance.cc
10
balance.cc
|
|
@ -99,10 +99,12 @@ void balance_t::write(std::ostream& out,
|
||||||
|
|
||||||
balance_t& balance_t::operator*=(const balance_t& bal)
|
balance_t& balance_t::operator*=(const balance_t& bal)
|
||||||
{
|
{
|
||||||
if (! *this || ! bal)
|
if (! *this || ! bal) {
|
||||||
return (*this = 0L);
|
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;
|
return *this *= (*bal.amounts.begin()).second;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
std::string msg;
|
std::string msg;
|
||||||
std::ostringstream errmsg(msg);
|
std::ostringstream errmsg(msg);
|
||||||
|
|
@ -163,10 +165,8 @@ balance_pair_t& balance_pair_t::operator/=(const balance_pair_t& bal_pair)
|
||||||
if (cost)
|
if (cost)
|
||||||
*cost /= bal_pair.cost ? *bal_pair.cost : bal_pair.quantity;
|
*cost /= bal_pair.cost ? *bal_pair.cost : bal_pair.quantity;
|
||||||
|
|
||||||
if (bal_pair.price && *bal_pair.price) {
|
if (bal_pair.price && *bal_pair.price && price)
|
||||||
if (price)
|
|
||||||
*price /= *bal_pair.price;
|
*price /= *bal_pair.price;
|
||||||
}
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue