From 1b2a30d442a2620599c3f12c2a774b66dc12229f Mon Sep 17 00:00:00 2001 From: Christopher Jones Date: Tue, 7 Mar 2023 11:35:17 -0600 Subject: [PATCH] Use anonymous namespace in CandIsolatorFromDeposits This appears to avoid an ASAN error when used with LTO. --- .../plugins/CandIsolatorFromDeposits.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/PhysicsTools/IsolationAlgos/plugins/CandIsolatorFromDeposits.cc b/PhysicsTools/IsolationAlgos/plugins/CandIsolatorFromDeposits.cc index f800cb77d708e..476a952d70dd9 100644 --- a/PhysicsTools/IsolationAlgos/plugins/CandIsolatorFromDeposits.cc +++ b/PhysicsTools/IsolationAlgos/plugins/CandIsolatorFromDeposits.cc @@ -60,11 +60,13 @@ using namespace edm; using namespace reco; using namespace reco::isodeposit; -bool isNumber(const std::string &str) { - static const std::regex re("^[+-]?(\\d+\\.?|\\d*\\.\\d*)$"); - return regex_match(str.c_str(), re); -} -double toNumber(const std::string &str) { return atof(str.c_str()); } +namespace { + bool isNumber(const std::string &str) { + static const std::regex re("^[+-]?(\\d+\\.?|\\d*\\.\\d*)$"); + return regex_match(str.c_str(), re); + } + double toNumber(const std::string &str) { return atof(str.c_str()); } +} // namespace CandIsolatorFromDeposits::SingleDeposit::SingleDeposit(const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC) : srcToken_(iC.consumes(iConfig.getParameter("src"))),