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 53bb7733ea899723e6a6de4ea71c30df57185442..14bad9f7f26a7ce82cd789b6540da6c9ec3b47b2 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)
 {
 void 
 DecayTable::AddDecayChannel(DecayChannel aChannel)
 {
index 3272631c1f1bca9d6cd72ca0593ef4136b32e62d..ca6280d8656881a1a6c4a7a606269cd5ad6a31f7 100644 (file)
@@ -38,6 +38,8 @@ class DecayTable
   DecayTable(const DecayTable& aTable);
   ~DecayTable();
   
   DecayTable(const DecayTable& aTable);
   ~DecayTable();
   
+  DecayTable& operator=(const DecayTable& aTable);
+
   void AddDecayChannel(DecayChannel aChannel);
 
   int  GetChannelCount() const;
   void AddDecayChannel(DecayChannel aChannel);
 
   int  GetChannelCount() const;