summaryrefslogtreecommitdiff
path: root/amount.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-25 21:51:11 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-08-25 21:51:11 -0400
commit69bd31b4d0386074713a35da319790b02648e479 (patch)
treef12b98b7e93046650ca56932827e43fd0015d545 /amount.cc
parentac000a67c4e9c75e11e43018e5f16242b4d99226 (diff)
downloadfork-ledger-69bd31b4d0386074713a35da319790b02648e479.tar.gz
fork-ledger-69bd31b4d0386074713a35da319790b02648e479.tar.bz2
fork-ledger-69bd31b4d0386074713a35da319790b02648e479.zip
added usual operator
Diffstat (limited to 'amount.cc')
-rw-r--r--amount.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/amount.cc b/amount.cc
index b72f9852..e0507c7c 100644
--- a/amount.cc
+++ b/amount.cc
@@ -276,11 +276,12 @@ amount_t& amount_t::operator=(const char * value)
// assignment operator
amount_t& amount_t::operator=(const amount_t& amt)
{
- if (amt.quantity)
- _copy(amt);
- else if (quantity)
- _clear();
-
+ if (this != &amt) {
+ if (amt.quantity)
+ _copy(amt);
+ else if (quantity)
+ _clear();
+ }
return *this;
}