Fix Coverity
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Dec 2011 15:47:54 +0000 (15:47 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 19 Dec 2011 15:47:54 +0000 (15:47 +0000)
TTherminator/Therminator/DecayTable.cxx
TTherminator/Therminator/DecayTable.h

index 53bb773..14bad9f 100644 (file)
@@ -47,6 +47,18 @@ DecayTable::~DecayTable()
 {
 }
 
+DecayTable& DecayTable::operator=(const DecayTable& aTable)
+{
+  if (this != &aTable) {
+    mDecayChannels.clear();
+    mBranchingRatios.clear();
+    for (int iter=0; iter<aTable.GetChannelCount(); iter++)
+      AddDecayChannel(*(aTable.GetDecayChannel(iter)));
+  }
+  
+  return *this;
+}
+
 void 
 DecayTable::AddDecayChannel(DecayChannel aChannel)
 {
index 3272631..ca6280d 100644 (file)
@@ -38,6 +38,8 @@ class DecayTable
   DecayTable(const DecayTable& aTable);
   ~DecayTable();
   
+  DecayTable& operator=(const DecayTable& aTable);
+
   void AddDecayChannel(DecayChannel aChannel);
 
   int  GetChannelCount() const;