From d8f6fe23d4916bdc470ea925b9aa1bc2d7dd77e8 Mon Sep 17 00:00:00 2001
From: Walter Lampl <Walter.Lampl@cern.ch>
Date: Mon, 23 Nov 2020 17:45:38 +0100
Subject: [PATCH] MuonCombinedInDetExtensionAlg: Avoid useless loop

---
 .../MuonCombinedAlgs/src/MuonCombinedInDetExtensionAlg.cxx  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetExtensionAlg.cxx b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetExtensionAlg.cxx
index a45343d9b6c..b6b4fba6864 100644
--- a/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetExtensionAlg.cxx
+++ b/Reconstruction/MuonIdentification/MuonCombinedAlgs/src/MuonCombinedInDetExtensionAlg.cxx
@@ -42,8 +42,10 @@ MuonCombinedInDetExtensionAlg::execute(const EventContext& ctx) const
 
     ATH_MSG_VERBOSE("Loaded InDetCandidateCollection " << m_indetCandidateCollectionName << " with  "
                                                        << indetCandidateCollection->size() << " elements.");
-    for (const MuonCombined::InDetCandidate* candidate : *indetCandidateCollection)
-        ATH_MSG_VERBOSE(candidate->toString());
+    if (msgLvl(MSG::VERBOSE)) {
+      for (const MuonCombined::InDetCandidate* candidate : *indetCandidateCollection)
+        msg(MSG::VERBOSE) << candidate->toString() << endmsg;
+    }
 
     SG::WriteHandle<MuonCombined::InDetCandidateToTagMap> tagMap(m_tagMap, ctx);
     ATH_CHECK(tagMap.record(std::make_unique<MuonCombined::InDetCandidateToTagMap>()));
-- 
GitLab