From 49346ba40866e799447a7b6a28ffc6c745e36447 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Wed, 26 Jun 2024 09:26:09 +0200 Subject: [PATCH] [core] swap table search and fPID Fixes https://its.cern.ch/jira/browse/ROOT-3594 --- core/cont/inc/TRefArray.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/cont/inc/TRefArray.h b/core/cont/inc/TRefArray.h index 253abd12a2bfe..4f87a6c798e85 100644 --- a/core/cont/inc/TRefArray.h +++ b/core/cont/inc/TRefArray.h @@ -180,10 +180,11 @@ inline TObject *TRefArray::At(Int_t at) const // Return the object at position i. Returns 0 if i is out of bounds. int j = at-fLowerBound; if (j >= 0 && j < fSize) { + TObject* obj = GetFromTable(j); // This properly returns 0 if the table is not available + if (obj) return obj; if (!fPID) return nullptr; if (!TProcessID::IsValid(fPID)) return nullptr; - TObject *obj = fPID->GetObjectWithID(fUIDs[j]); - if (!obj) obj = GetFromTable(j); + obj = fPID->GetObjectWithID(fUIDs[j]); return obj; } BoundsOk("At", at);