Skip to content

Commit 60b71f4

Browse files
pcanalvepadulano
authored andcommitted
TChain::GetEntries apply FriendLockStatus.
Avoid calling LoadTree when it will be a no-op and especially don't undo work we wont be able to redo
1 parent 92816a8 commit 60b71f4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tree/tree/src/TChain.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,10 @@ Long64_t TChain::GetEntries() const
985985
return fProofChain->GetEntries();
986986
}
987987
if (fEntries == TTree::kMaxEntries) {
988+
// If the following is true, we are within a recursion about friend,
989+
// and `LoadTree` will be no-op.
990+
if (kLoadTree & fFriendLockStatus)
991+
return fEntries;
988992
const auto readEntry = fReadEntry;
989993
auto *thisChain = const_cast<TChain *>(this);
990994
thisChain->LoadTree(TTree::kMaxEntries - 1);

0 commit comments

Comments
 (0)