From 79f41e3696657da2c4a63b321b562f4c6fff6826 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Mon, 9 Dec 2024 11:30:51 +0100 Subject: [PATCH] Don't compare to nullptr --- k4MarlinWrapper/src/components/Lcio2EDM4hep.cpp | 4 ++-- k4MarlinWrapper/src/components/LcioEventAlgo.cpp | 2 +- k4MarlinWrapper/src/components/MarlinProcessorWrapper.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/k4MarlinWrapper/src/components/Lcio2EDM4hep.cpp b/k4MarlinWrapper/src/components/Lcio2EDM4hep.cpp index 0654e4d1..078d6479 100644 --- a/k4MarlinWrapper/src/components/Lcio2EDM4hep.cpp +++ b/k4MarlinWrapper/src/components/Lcio2EDM4hep.cpp @@ -49,7 +49,7 @@ Lcio2EDM4hepTool::Lcio2EDM4hepTool(const std::string& type, const std::string& n StatusCode Lcio2EDM4hepTool::initialize() { m_podioDataSvc = dynamic_cast(m_eds.get()); - if (nullptr == m_podioDataSvc) + if (!m_podioDataSvc) return StatusCode::FAILURE; return AlgTool::initialize(); @@ -74,7 +74,7 @@ bool Lcio2EDM4hepTool::collectionExist(const std::string& collection_name) { void Lcio2EDM4hepTool::registerCollection( std::tuple> namedColl, EVENT::LCCollection* lcioColl) { auto& [name, e4hColl] = namedColl; - if (e4hColl == nullptr) { + if (!e4hColl) { error() << "Could not convert collection " << name << endmsg; return; } diff --git a/k4MarlinWrapper/src/components/LcioEventAlgo.cpp b/k4MarlinWrapper/src/components/LcioEventAlgo.cpp index ae7e04ed..6f04d3b3 100644 --- a/k4MarlinWrapper/src/components/LcioEventAlgo.cpp +++ b/k4MarlinWrapper/src/components/LcioEventAlgo.cpp @@ -41,7 +41,7 @@ StatusCode LcioEvent::initialize() { StatusCode LcioEvent::execute(const EventContext&) const { auto theEvent = m_reader->readNextEvent(EVENT::LCIO::UPDATE); - if (theEvent == nullptr) { + if (!theEvent) { // Store flag to indicate there was NOT a LCEvent auto pStatus = std::make_unique(false); const StatusCode scStatus = eventSvc()->registerObject("/Event/LCEventStatus", pStatus.release()); diff --git a/k4MarlinWrapper/src/components/MarlinProcessorWrapper.cpp b/k4MarlinWrapper/src/components/MarlinProcessorWrapper.cpp index 61050882..4d896de6 100644 --- a/k4MarlinWrapper/src/components/MarlinProcessorWrapper.cpp +++ b/k4MarlinWrapper/src/components/MarlinProcessorWrapper.cpp @@ -81,7 +81,7 @@ StatusCode MarlinProcessorWrapper::loadProcessorLibraries() const { // Load all libraries from the marlin_dll info() << "looking for marlindll" << endmsg; const char* const marlin_dll = getenv("MARLIN_DLL"); - if (marlin_dll == nullptr) { + if (!marlin_dll) { warning() << "MARLIN_DLL not set, not loading any processors " << endmsg; } else { info() << "Found marlin_dll " << marlin_dll << endmsg;