From b3640a09b4c479e2ed3573cc644cdd79e630ea5e Mon Sep 17 00:00:00 2001
From: "Stephen A. Wood" <saw@jlab.org>
Date: Tue, 20 Feb 2018 10:50:19 -0500
Subject: [PATCH] Add THcFormula copy constructor and simplify operator=

---
 src/THcFormula.cxx | 12 ++++++++----
 src/THcFormula.h   |  1 +
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/THcFormula.cxx b/src/THcFormula.cxx
index dd97ae7..210e681 100644
--- a/src/THcFormula.cxx
+++ b/src/THcFormula.cxx
@@ -85,15 +85,19 @@ THcFormula::THcFormula(const char* name, const char* expression,
 THcFormula& THcFormula::operator=( const THcFormula& rhs )
 {
   if( this != &rhs ) {
-    TFormula::operator=(rhs);
+    THaFormula::operator=(rhs);
     fParmList = rhs.fParmList;
-    fVarList = rhs.fVarList;
-    fCutList = rhs.fCutList;
-    fInstance = 0;
   }
   return *this;
 }
 
+//_____________________________________________________________________________
+THcFormula::THcFormula( const THcFormula& rhs ) :
+  THaFormula(rhs), fParmList(rhs.fParmList)
+{
+  // Copy ctor
+}
+
 //_____________________________________________________________________________
 THcFormula::~THcFormula()
 {
diff --git a/src/THcFormula.h b/src/THcFormula.h
index a75a020..5bfd6aa 100644
--- a/src/THcFormula.h
+++ b/src/THcFormula.h
@@ -19,6 +19,7 @@ public:
   THcFormula( const char* name, const char* formula,
 	      const THcParmList*, const THaVarList*,
 	      const THaCutList* clst);
+  THcFormula( const THcFormula& rhs );
   THcFormula& operator=( const THcFormula& rhs );
   virtual ~THcFormula();
 
-- 
GitLab