Skip to content

Commit

Permalink
Remove LIKELY and UNLIKELY
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Jul 28, 2023
1 parent e1ef940 commit b03d604
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions k4FWCore/include/k4FWCore/DataHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ template <typename T> const T* DataHandle<T>::get() {
DataObject* dataObjectp = nullptr;
auto sc = m_eds->retrieveObject(DataObjectHandle<DataWrapper<T>>::fullKey().key(), dataObjectp);

if (LIKELY(sc.isSuccess())) {
if (UNLIKELY(!m_isGoodType && !m_isCollection)) {
if (sc.isSuccess()) {
if (!m_isGoodType && !m_isCollection) {
// only do this once (if both are false after this, we throw exception)
m_isGoodType = nullptr != dynamic_cast<DataWrapper<T>*>(dataObjectp);
if (!m_isGoodType) {
Expand All @@ -142,7 +142,7 @@ template <typename T> const T* DataHandle<T>::get() {
}
}
}
if (LIKELY(m_isGoodType)) {
if (m_isGoodType) {
return static_cast<DataWrapper<T>*>(dataObjectp)->getData();
} else if (m_isCollection) {
// The reader does not know the specific type of the collection. So we need a reinterpret_cast if the handle was
Expand Down

0 comments on commit b03d604

Please sign in to comment.