From c04b1c7c02c3991fdddb02d88dba00bba6597a44 Mon Sep 17 00:00:00 2001 From: scott snyder <sss@karma> Date: Mon, 22 Jun 2020 11:36:42 -0400 Subject: [PATCH] PyAnalysisCore: Fix clang 10 warning. Fix use of dangling iterators. --- .../PyAnalysisCore/PyAnalysisCore/PyDataHeader.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/PhysicsAnalysis/PyAnalysis/PyAnalysisCore/PyAnalysisCore/PyDataHeader.h b/PhysicsAnalysis/PyAnalysis/PyAnalysisCore/PyAnalysisCore/PyDataHeader.h index 5863e42b1d05..aa5e0f085bae 100755 --- a/PhysicsAnalysis/PyAnalysis/PyAnalysisCore/PyAnalysisCore/PyDataHeader.h +++ b/PhysicsAnalysis/PyAnalysis/PyAnalysisCore/PyAnalysisCore/PyDataHeader.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef PYANALYSISCORE_PYDATAHEADER_H @@ -73,17 +73,15 @@ public: // look for non-symlink name std::string name=""; - std::set<CLID>::iterator itCLID = ((*it)->getClassIDs()).begin(); - std::set<CLID>::iterator itCLIDe = ((*it)->getClassIDs()).end(); - for (; itCLID != itCLIDe; ++itCLID) + for (CLID clid : (*it)->getClassIDs()) { // convert CLID to class name std::string localName; - StatusCode sc = m_classIDSvc->getTypeNameOfID (*itCLID, localName); + StatusCode sc = m_classIDSvc->getTypeNameOfID (clid, localName); if (sc.isFailure()) { MsgStream log(Athena::getMessageSvc(), "PyDataHeader"); - log << MSG::ERROR << "could not get TypeName for " << *itCLID << endmsg; + log << MSG::ERROR << "could not get TypeName for " << clid << endmsg; return ""; } // select non-symlink -- GitLab