]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDarrayF.cxx
Adding directory with the production requests
[u/mrichter/AliRoot.git] / TRD / AliTRDarrayF.cxx
index 9f1ebf08bafa8c8198a59d14c6b8c01a162083a3..51883b2f832c0a0fe02d6e3d244dbb909fd60cd6 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.4  2000/06/09 11:10:07  cblume
-Compiler warnings and coding conventions, next round
-
-Revision 1.3  2000/06/08 18:32:58  cblume
-Make code compliant to coding conventions
-
-Revision 1.2  2000/05/08 16:17:27  cblume
-Merge TRD-develop
-
-Revision 1.1.2.1  2000/05/08 14:35:38  cblume
-Add float array
-
-*/
+/* $Id$ */
 
 ///////////////////////////////////////////////////////////////////////
 //                                                                   //  
@@ -60,10 +46,15 @@ AliTRDarrayF::~AliTRDarrayF()
   // Default destructor
   //
 
+  if (fArray) {
+    delete [] fArray;
+    fArray = 0;
+  }
+
 }
 
 //_____________________________________________________________________________
-void AliTRDarrayF::Copy(TObject &a)
+void AliTRDarrayF::Copy(TObject &a) const
 {
   //
   // Copy function
@@ -84,11 +75,17 @@ void AliTRDarrayF::Expand(Int_t n)
   // The user is responsible for the appropriate size of the array.
   //
 
-  if (n < 0) return;  
-  fArray = (Float_t*) TStorage::ReAlloc(fArray
-                                       ,n  * sizeof(Float_t)
-                                       ,fN * sizeof(Float_t));
-  if (fArray != 0) fN = n;
+  if (n < 0) {
+    return;  
+  }
+
+  fArray = (Float_t *) TStorage::ReAlloc(fArray
+                                        ,n *sizeof(Float_t)
+                                        ,fN*sizeof(Float_t));
+
+  if (fArray != 0) {
+    fN = n;
+  } 
+
 }