From 835ce30ededc234e401c817e13910caeabe6fc47 Mon Sep 17 00:00:00 2001 From: Shahzad Malik Muzaffar Date: Wed, 18 Dec 2024 08:28:55 +0100 Subject: [PATCH] [RECONSTRUCTION-XPOG] Apply code checks/format --- DataFormats/PatCandidates/src/TriggerObjectStandAlone.cc | 4 ++-- PhysicsTools/PatAlgos/plugins/DeDxEstimatorRekeyer.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DataFormats/PatCandidates/src/TriggerObjectStandAlone.cc b/DataFormats/PatCandidates/src/TriggerObjectStandAlone.cc index b60631737c7e3..cf9ffef12b9cb 100644 --- a/DataFormats/PatCandidates/src/TriggerObjectStandAlone.cc +++ b/DataFormats/PatCandidates/src/TriggerObjectStandAlone.cc @@ -99,7 +99,7 @@ bool TriggerObjectStandAlone::hasAnyName(const std::string &name, const std::vec // Empty parts due to // - wild-card at beginning/end or // - multiple wild-cards (should be supressed by 'boost::token_compress_on') - if (iName->length() == 0) + if (iName->empty()) continue; // Search from current index and // set index to found occurence @@ -115,7 +115,7 @@ bool TriggerObjectStandAlone::hasAnyName(const std::string &name, const std::vec index += iName->length(); } // Failed, if end of name not reached - if (index < iVec->length() && namePartsVec.back().length() != 0) + if (index < iVec->length() && !namePartsVec.back().empty()) failed = true; // Match found! if (!failed) diff --git a/PhysicsTools/PatAlgos/plugins/DeDxEstimatorRekeyer.cc b/PhysicsTools/PatAlgos/plugins/DeDxEstimatorRekeyer.cc index 0a91c694ec94e..54d487ddc33bd 100644 --- a/PhysicsTools/PatAlgos/plugins/DeDxEstimatorRekeyer.cc +++ b/PhysicsTools/PatAlgos/plugins/DeDxEstimatorRekeyer.cc @@ -113,7 +113,7 @@ void DeDxEstimatorRekeyer::produce(edm::StreamID, edm::Event& iEvent, const edm: auto dedxHitInfoAssociation = std::make_unique(dedxHitInfoHandle); reco::DeDxHitInfoAss::Filler filler(*dedxHitInfoAssociation); auto resultdedxHitColl = std::make_unique(); - resultdedxHitColl->reserve(pcTrkMap.size() > 0 ? pcTrkMap.size() * pcTrkMap[0].second.size() : 0); + resultdedxHitColl->reserve(!pcTrkMap.empty() ? pcTrkMap.size() * pcTrkMap[0].second.size() : 0); std::vector> momenta; momenta.reserve(resultdedxHitColl->capacity()); // Loop over packed candidates