Adding a warning parameter to the Add method (Laurent)
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 17 Oct 2007 13:01:44 +0000 (13:01 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 17 Oct 2007 13:01:44 +0000 (13:01 +0000)
MUON/mapping/AliMpArrayI.cxx
MUON/mapping/AliMpArrayI.h

index 85dc1f4c9f44779fb16cbd9d990f4257462b7798..6a07f2fc9012060eec9fa8d5be0193531e912c6f 100644 (file)
@@ -91,17 +91,20 @@ Int_t  AliMpArrayI::GetPosition(Int_t value) const
 //
 
 //_____________________________________________________________________________
 //
 
 //_____________________________________________________________________________
-Bool_t AliMpArrayI::Add(Int_t value)
+Bool_t AliMpArrayI::Add(Int_t value, Bool_t warn)
 {
 /// Add object with its key to the map and arrays
   
   // Resize array if needed
 {
 /// Add object with its key to the map and arrays
   
   // Resize array if needed
-  if ( fValues.GetSize() == fNofValues ) {
-   fValues.Set(2*fValues.GetSize());
-   AliWarningStream() << "Resized array." << endl;
+  if ( fValues.GetSize() == fNofValues ) 
+  {
+    fValues.Set(2*fValues.GetSize());
+    if ( warn ) 
+    {
+      AliWarningStream() << "Resized array." << endl;
+    }
   }
   
   }
   
-  
   // The position for the new value  
   Int_t pos;
   if ( fSort ) {
   // The position for the new value  
   Int_t pos;
   if ( fSort ) {
index c3da87f27db8f7557db126c1aa2c3760c3caff2a..12e5205fcd9a7ec70f1787397dc501c943982fb2 100644 (file)
@@ -28,7 +28,7 @@ class AliMpArrayI : public TObject
     virtual ~AliMpArrayI();
     
     // methods
     virtual ~AliMpArrayI();
     
     // methods
-    Bool_t Add(Int_t value);
+    Bool_t Add(Int_t value, Bool_t warn=kTRUE);
     Bool_t Remove(Int_t value);
 
     // set methods
     Bool_t Remove(Int_t value);
 
     // set methods