Skip to content

Commit

Permalink
simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
giovannimarchiori committed Aug 29, 2024
1 parent 2a9e592 commit c9cdec5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 20 deletions.
15 changes: 5 additions & 10 deletions RecFCCeeCalorimeter/src/components/CalibrateCaloClusters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,23 +173,18 @@ StatusCode CalibrateCaloClusters::finalize()
if (m_ortEnv)
delete m_ortEnv;

for (std::size_t i = 0; i < m_input_names.size(); i++) {
if (m_input_names.at(i)) {
delete m_input_names.at(i);
}
for (auto& name : m_input_names) {
delete name;
}
m_input_names.resize(0);

for (std::size_t i = 0; i < m_output_names.size(); i++) {
if (m_output_names.at(i)) {
delete m_output_names.at(i);
}
for (auto& name : m_output_names) {
delete name;
}
m_output_names.resize(0);

return Gaudi::Algorithm::finalize();
}


edm4hep::ClusterCollection *CalibrateCaloClusters::initializeOutputClusters(
const edm4hep::ClusterCollection *inClusters) const
{
Expand Down
14 changes: 4 additions & 10 deletions RecFCCeeCalorimeter/src/components/PhotonIDTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,13 @@ StatusCode PhotonIDTool::finalize()
if (m_ortEnv)
delete m_ortEnv;

for (std::size_t i = 0; i < m_input_names.size(); i++) {
if (m_input_names.at(i)) {
delete m_input_names.at(i);
}
for (auto& name : m_input_names) {
delete name;
}
m_input_names.resize(0);

for (std::size_t i = 0; i < m_output_names.size(); i++) {
if (m_output_names.at(i)) {
delete m_output_names.at(i);
}
for (auto& name : m_output_names) {
delete name;
}
m_output_names.resize(0);

return Gaudi::Algorithm::finalize();
}
Expand Down

0 comments on commit c9cdec5

Please sign in to comment.