From c3882ed03f60a71d47696675b290a4f7a178eb7e Mon Sep 17 00:00:00 2001 From: ivana Date: Wed, 17 Oct 2007 13:01:44 +0000 Subject: [PATCH] Adding a warning parameter to the Add method (Laurent) --- MUON/mapping/AliMpArrayI.cxx | 13 ++++++++----- MUON/mapping/AliMpArrayI.h | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/MUON/mapping/AliMpArrayI.cxx b/MUON/mapping/AliMpArrayI.cxx index 85dc1f4c9f4..6a07f2fc901 100644 --- a/MUON/mapping/AliMpArrayI.cxx +++ b/MUON/mapping/AliMpArrayI.cxx @@ -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 - 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 ) { diff --git a/MUON/mapping/AliMpArrayI.h b/MUON/mapping/AliMpArrayI.h index c3da87f27db..12e5205fcd9 100644 --- a/MUON/mapping/AliMpArrayI.h +++ b/MUON/mapping/AliMpArrayI.h @@ -28,7 +28,7 @@ class AliMpArrayI : public TObject 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 -- 2.31.1