]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALTrack.cxx
One more attempt to fix coverity MISSING_COPY
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALTrack.cxx
index b21a064cd2ba52a6a716afcbe1d04907b7bd0b85..4b4d32d000879925de0398ec161aeb772f3b3a39 100644 (file)
@@ -113,21 +113,12 @@ AliEMCALTrack::AliEMCALTrack(const AliEMCALTrack& t)
 //
 //------------------------------------------------------------------------------
 //
-AliEMCALTrack& AliEMCALTrack::operator=(const AliEMCALTrack &t)
-{
-       //
-       // Assignment operator
-       // Works like copy constructor
-       //
-       
-       fClusterIndex = t.fClusterIndex;
-       fClusterDist = t.fClusterDist;
-       
-       fMass = t.fMass;
-       
-       fSeedIndex = t.fSeedIndex;
-       fSeedLabel = t.fSeedLabel;
-       return *this;
+AliEMCALTrack& AliEMCALTrack::operator=(const AliEMCALTrack &source)
+{ // assignment operator; use copy ctor
+  if (&source == this) return *this;
+
+  new (this) AliEMCALTrack(source);
+  return *this;
 }
 //
 //------------------------------------------------------------------------------