diff options
-rw-r--r-- | src/amount.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/amount.cc b/src/amount.cc index 50496f2d..5e933215 100644 --- a/src/amount.cc +++ b/src/amount.cc @@ -395,11 +395,11 @@ int amount_t::compare(const amount_t& amt) const throw_(amount_error, _("Cannot compare two uninitialized amounts")); } - if (has_commodity() && amt.has_commodity() && - commodity() != amt.commodity()) + if (has_commodity() && amt.has_commodity() && commodity() != amt.commodity()) { throw_(amount_error, _("Cannot compare amounts with different commodities: '%1' and '%2'") << commodity() << amt.commodity()); + } return mpq_cmp(MP(quantity), MP(amt.quantity)); } @@ -460,11 +460,11 @@ amount_t& amount_t::operator-=(const amount_t& amt) throw_(amount_error, _("Cannot subtract two uninitialized amounts")); } - if (has_commodity() && amt.has_commodity() && - commodity() != amt.commodity()) + if (has_commodity() && amt.has_commodity() && commodity() != amt.commodity()) { throw_(amount_error, _("Subtracting amounts with different commodities: '%1' != '%2'") << commodity() << amt.commodity()); + } _dup(); |