diff --git a/Control/AthenaKernel/AthenaKernel/DataBucketBase.icc b/Control/AthenaKernel/AthenaKernel/DataBucketBase.icc index 865698c33fccb9d6e655961b55478096038078da..8b1302bfc19db4669d071e9f902a9ec01a28b606 100755 --- a/Control/AthenaKernel/AthenaKernel/DataBucketBase.icc +++ b/Control/AthenaKernel/AthenaKernel/DataBucketBase.icc @@ -54,4 +54,3 @@ void* DataBucketBase::cast (CLID /*clid*/, { return cast (tinfo, irt, isConst); } - diff --git a/Control/AthenaKernel/AthenaKernel/StorableConversions.h b/Control/AthenaKernel/AthenaKernel/StorableConversions.h index a0f3990a7d3824416009ed2ea2666b3763e95fdf..d60dbd25176c504c8ec7ff38eae416e9e58cb8cc 100755 --- a/Control/AthenaKernel/AthenaKernel/StorableConversions.h +++ b/Control/AthenaKernel/AthenaKernel/StorableConversions.h @@ -1,7 +1,7 @@ // This file's extension implies that it's C, but it's really -*- C++ -*-. /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration */ #ifndef ATHENAKERNEL_STORABLECONVERSIONS_H @@ -186,7 +186,6 @@ namespace SG { bool isConst /*= true*/) { typedef typename std::remove_const<T>::type T_nc; - typedef typename DataBucketTrait<T_nc>::type bucket_t; DataBucketTrait<T_nc>::init(); //check inputs @@ -200,19 +199,11 @@ namespace SG { } // get T* from DataBucket: - SG::DataBucket<T_nc>* bucketPtr = dynamic_cast<bucket_t*>(pDObj); - bool success(0 != bucketPtr); - if (success) - pTrans = *bucketPtr; - else { - // Try to use BaseInfo information to convert pointers. - DataBucketBase* b = dynamic_cast<DataBucketBase*>(pDObj); - if (b) { - pTrans = b->template cast<T_nc> (irt, isConst); - if (pTrans) - success = true; - } - } + // All objects in the event store nowadays are instances + // of DataBucket, so just do a static_cast. + DataBucketBase* b = static_cast<DataBucketBase*>(pDObj); + pTrans = b->template cast<T_nc> (irt, isConst); + bool success = pTrans != nullptr; #ifndef NDEBUG if (!quiet && !success) {