X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSpList.cxx;h=837552a5a1d55c5ea39b5c5165a60dfd772025d0;hb=e56160b864358b3c13ff606b467fd385d843254c;hp=7c6e821b0eb2cb23bdd5fc4294139a940f14a347;hpb=2bb7b766a5d5ad24dfcc7fe8b86f2fcc7e8d3a1b;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSpList.cxx b/ITS/AliITSpList.cxx index 7c6e821b0eb..837552a5a1d 100644 --- a/ITS/AliITSpList.cxx +++ b/ITS/AliITSpList.cxx @@ -32,7 +32,11 @@ ClassImp(AliITSpList) //______________________________________________________________________ -AliITSpList::AliITSpList(){ +AliITSpList::AliITSpList(): +fNi(0), +fNj(0), +fa(0), +fEntries(0){ // Default constructor // Inputs: // none. @@ -41,12 +45,13 @@ AliITSpList::AliITSpList(){ // Return: // A zeroed/empty AliITSpList class. - fNi = 0; - fNj = 0; - fa = 0; } //______________________________________________________________________ -AliITSpList::AliITSpList(Int_t imax,Int_t jmax){ +AliITSpList::AliITSpList(Int_t imax,Int_t jmax): +fNi(imax), +fNj(jmax), +fa(0), +fEntries(0){ // Standard constructor // Inputs: // none. @@ -55,9 +60,6 @@ AliITSpList::AliITSpList(Int_t imax,Int_t jmax){ // Return: // A setup AliITSpList class. - fNi = imax; - fNj = jmax; - fEntries = 0; fa = new TClonesArray("AliITSpListItem",fNi*fNj); } //______________________________________________________________________ @@ -121,28 +123,16 @@ AliITSpList& AliITSpList::operator=(const AliITSpList &source){ // Return: // A copied AliITSpList object. - if(this == &source) return *this; - - if(this->fa!=0){ // if this->fa exists delete it first. - fa->Delete(); - delete fa; - fa = 0; - } // end if this->fa!=0 - this->fNi = source.fNi; - this->fNj = source.fNj; - this->fa = new TClonesArray(*(source.fa)); - this->fEntries = source.fEntries; - - return *this; + this->~AliITSpList(); + new(this) AliITSpList(source); + return *this; } //______________________________________________________________________ -AliITSpList::AliITSpList(const AliITSpList &source) : AliITSMap(source){ +AliITSpList::AliITSpList(const AliITSpList &source) : AliITSMap(source), +fNi(source.fNi),fNj(source.fNj),fa(0),fEntries(source.fEntries){ // Copy constructor - fNi = source.fNi; - fNj = source.fNj; fa = new TClonesArray(*(source.fa)); - fEntries = source.fEntries; } //______________________________________________________________________ void AliITSpList::AddItemTo(Int_t fileIndex, AliITSpListItem *pl) {