From 1cbec5cd1c0f838b00d02fe8fe519a946ce162fd Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Mon, 28 Oct 2024 21:41:43 +0100 Subject: [PATCH] Simplify logic a bit --- k4MarlinWrapper/src/components/EDM4hep2Lcio.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/k4MarlinWrapper/src/components/EDM4hep2Lcio.cpp b/k4MarlinWrapper/src/components/EDM4hep2Lcio.cpp index ac02ee83..793ecb64 100644 --- a/k4MarlinWrapper/src/components/EDM4hep2Lcio.cpp +++ b/k4MarlinWrapper/src/components/EDM4hep2Lcio.cpp @@ -292,12 +292,10 @@ podio::CollectionBase* EDM4hep2LcioTool::getEDM4hepCollection(const std::string& // std::shared_ptr but this has been removed in k4FWCore so it can be deleted // at some point auto uptr = dynamic_cast>*>(p); - AnyDataWrapper>* sptr = nullptr; - if (!uptr) { - sptr = dynamic_cast>*>(p); - } else { + if (uptr) { return uptr->getData().get(); } + auto sptr = dynamic_cast>*>(p); if (sptr) { return sptr->getData().get(); }