# UNDF: UNDF-2026-000001152 # UNDF: --- a/tree/tree/src/TTreeCache.cxx +++ b/tree/tree/src/TTreeCache.cxx @@ -299,6 +299,7 @@ #include "TRegexp.h" #include "TLeaf.h" #include "TFriendElement.h" #include "TFile.h" #include "TMath.h" #include "TBranchCacheInfo.h" #include "TVirtualPerfStats.h" #include +#include #include @@ -1378,7 +1378,7 @@ Int_t nReachedEnd = 0; Int_t nSkipped = 0; auto oldnReadPrefRequest = nReadPrefRequest; - std::vector potentialVetoes; + std::unordered_set potentialVetoes; if (showMore || gDebug > 7) Info("CollectBaskets", "Called with pass=%d narrow=%d maxCollectEntry=%lld", pass, narrow, maxCollectEntry); @@ -1395,7 +1395,7 @@ potentialVetoes.clear(); if (pass == kStart && !cursor[i].fLoadedOnce && resetBranchInfo) { // First check if we have any cluster that is currently in the // cache but was not used and would be reloaded in the next // cluster. - b->fCacheInfo.GetUnused(potentialVetoes); + { std::vector tmp; b->fCacheInfo.GetUnused(tmp); for (auto v : tmp) potentialVetoes.insert(v); } if (showMore || gDebug > 7) { TString vetolist; for(auto v : potentialVetoes) { @@ -1508,7 +1508,7 @@ - if (std::find(std::begin(potentialVetoes), std::end(potentialVetoes), j) != std::end(potentialVetoes)) { + if (potentialVetoes.count(j)) { // This basket was in the previous cache/cluster and was not used, // let's not read it again. I.e. we bet that it will continue to not // be used. At worst it will be used and thus read by itself.