]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fix in compapctification of object before cloning
authorshahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 12 Apr 2011 10:48:59 +0000 (10:48 +0000)
committershahoian <shahoian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 12 Apr 2011 10:48:59 +0000 (10:48 +0000)
STEER/AliRefArray.cxx
STEER/AliRefArray.h

index 94739ac67221326ea3225ece1775ea6933d9dcf3..14fa576f5ff3962604a8d95bea19782330e7d80c 100644 (file)
@@ -63,7 +63,7 @@ AliRefArray& AliRefArray::operator=(const AliRefArray& src)
     fRefInd = 0;
     fRefBuff = 0;
     if (src.fRefInd) {
-      fRefSize = src.fRefInd[0]+1;
+      fRefSize = src.fRefInd[0];
       fRefInd  = new UInt_t[fRefSize];
       fRefBuff = new UInt_t[fRefSize];
       memcpy(fRefInd, src.fRefInd, fRefSize*sizeof(UInt_t));
@@ -127,8 +127,8 @@ void AliRefArray::ExpandReferences(Int_t addSize)
   UInt_t*   ind  = new UInt_t[fRefSize];
   if (fRefBuff) memcpy(buff, fRefBuff, oldSize*sizeof(UInt_t)); // copy current content
   if (fRefInd)  memcpy(ind,  fRefInd,  oldSize*sizeof(UInt_t));
-  memset(buff+oldSize,0,(fRefSize-oldSize)*sizeof(UInt_t));
-  memset(ind +oldSize,0,(fRefSize-oldSize)*sizeof(UInt_t));
+  memset(buff+oldSize,0,addSize*sizeof(UInt_t));
+  memset(ind +oldSize,0,addSize*sizeof(UInt_t));
   delete[] fRefBuff; fRefBuff = buff;
   delete[] fRefInd;  fRefInd  = ind;
   if (!oldSize) fRefInd[0] = 1;
index c2c15b439829e7d889696c5629727ef41aa910ed..18377d1b8ef1a47be088805f5a30dfa97dbc6ae5 100644 (file)
@@ -106,7 +106,7 @@ inline void AliRefArray::AddReference(UInt_t from, UInt_t to)
 inline void AliRefArray::Compactify()
 {
   // prepare for storing with minimal space usage
-  if (fRefInd && fRefSize>(fRefInd[0]+1)) fRefSize = fRefInd[0]+1;
+  if (fRefInd && fRefSize>fRefInd[0]) fRefSize = fRefInd[0];
 }
   
 #endif