From c1141445c3cbc6818336aa19d8957bb7cac29465 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Fri, 30 Jun 2023 14:56:32 +0200 Subject: [PATCH] Only create an internal pointer if necessary --- k4FWCore/include/k4FWCore/DataHandle.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/k4FWCore/include/k4FWCore/DataHandle.h b/k4FWCore/include/k4FWCore/DataHandle.h index 8485fe54..486e35b6 100644 --- a/k4FWCore/include/k4FWCore/DataHandle.h +++ b/k4FWCore/include/k4FWCore/DataHandle.h @@ -77,7 +77,9 @@ DataHandle::DataHandle(const std::string& descriptor, Gaudi::DataHandle::Mode podio_data_service = dynamic_cast(m_eds.get()); if (nullptr != podio_data_service) { - m_dataPtr = new T(); + if constexpr(std::is_integral_v || std::is_floating_point_v) { + m_dataPtr = new T(); + } } else { // This is the legacy implementation kept for a transition period PodioLegacyDataSvc* plds;