From 69bd31b4d0386074713a35da319790b02648e479 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 25 Aug 2004 21:51:11 -0400 Subject: added usual operator --- amount.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'amount.cc') 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; } -- cgit v1.2.3