- call Copy function only once
- check for assignment to self
(Laurent)
AliMUONCluster::operator=(const AliMUONCluster& src)
{
/// assignement operator
- AliMUONCluster c(src);
- c.Copy(*this);
+ if ( this != &src )
+ {
+ src.Copy(*this);
+ }
return *this;
}
{
/// Assignement operator.
- AliMUONDigit a(digit);
- a.Copy(*this);
+ if ( this != &digit )
+ {
+ digit.Copy(*this);
+ }
return *this;
}
AliMUONObjectPair::operator=(const AliMUONObjectPair& other)
{
/// assignement operator
- AliDebug(1,"");
- AliMUONObjectPair pair(other);
- pair.Copy(*this);
+ if ( this != &other)
+ {
+ other.Copy(*this);
+ }
return *this;
}