diff --git a/core/base/src/TColor.cxx b/core/base/src/TColor.cxx
index 49c183210bf04838ae121fe3448ada28cbfe429b..21077daa8ce84b99290e5cfd3799f4bd8dc3107a 100644
--- a/core/base/src/TColor.cxx
+++ b/core/base/src/TColor.cxx
@@ -1058,7 +1058,10 @@ TColor::TColor(Float_t r, Float_t g, Float_t b, Float_t a): TNamed("","")
TColor::~TColor()
{
gROOT->GetListOfColors()->Remove(this);
- if (gROOT->GetListOfColors()->GetEntries() == 0) {fgPalette.Set(0); fgPalette=0;}
+ if (gROOT->GetListOfColors()->IsEmpty()) {
+ fgPalette.Set(0);
+ fgPalette=0;
+ }
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/core/base/src/TUrl.cxx b/core/base/src/TUrl.cxx
index 71b6e5be9d70cd1e5fef95f13bc9694f5b53f590..c2268472595de1139bab6a954e3c716f643fe171 100644
--- a/core/base/src/TUrl.cxx
+++ b/core/base/src/TUrl.cxx
@@ -623,14 +623,14 @@ void TUrl::ParseOptions() const
return;
TObjArray *objOptions = urloptions.Tokenize("&");
- for (Int_t n = 0; n < objOptions->GetEntries(); n++) {
+ for (Int_t n = 0; n < objOptions->GetEntriesFast(); n++) {
TString loption = ((TObjString *) objOptions->At(n))->GetName();
TObjArray *objTags = loption.Tokenize("=");
if (!fOptionsMap) {
fOptionsMap = new TMap;
fOptionsMap->SetOwnerKeyValue();
}
- if (objTags->GetEntries() == 2) {
+ if (objTags->GetEntriesFast() == 2) {
TString key = ((TObjString *) objTags->At(0))->GetName();
TString value = ((TObjString *) objTags->At(1))->GetName();
fOptionsMap->Add(new TObjString(key), new TObjString(value));
diff --git a/core/meta/src/TClass.cxx b/core/meta/src/TClass.cxx
index f48a539d30d7ae9a16d69465eb0364f6aff1164b..4c41e296e74a66a3d90362e32ba386c70577bc51 100644
--- a/core/meta/src/TClass.cxx
+++ b/core/meta/src/TClass.cxx
@@ -6281,7 +6281,7 @@ void TClass::SetUnloaded()
(*fEnums).Unload();
}
- if (fState <= kForwardDeclared && fStreamerInfo->GetEntries() != 0) {
+ if (fState <= kForwardDeclared && !fStreamerInfo->IsEmpty()) {
fState = kEmulated;
}
diff --git a/core/meta/src/TSchemaRuleSet.cxx b/core/meta/src/TSchemaRuleSet.cxx
index 26ede7ad40559f4e2ca3e57fa90470aa36f95a0f..c06ba106d16d9db4ec86955b4903e8275556c78d 100644
--- a/core/meta/src/TSchemaRuleSet.cxx
+++ b/core/meta/src/TSchemaRuleSet.cxx
@@ -113,7 +113,7 @@ Bool_t TSchemaRuleSet::AddRule( TSchemaRule* rule, EConsistencyCheck checkConsis
bool streamerInfosTest;
{
R__LOCKGUARD(gInterpreterMutex);
- streamerInfosTest = (fClass->GetStreamerInfos()==0 || fClass->GetStreamerInfos()->GetEntries()==0);
+ streamerInfosTest = (fClass->GetStreamerInfos()==0 || fClass->GetStreamerInfos()->IsEmpty());
}
if( rule->GetTarget() && !(fClass->TestBit(TClass::kIsEmulation) && streamerInfosTest) ) {
TObjArrayIter titer( rule->GetTarget() );
@@ -495,7 +495,7 @@ Bool_t TSchemaRuleSet::TMatches::HasRuleWithSource( const TString& name, Bool_t
if( rule->HasSource( name ) ) {
if (needingAlloc) {
const TObjArray *targets = rule->GetTarget();
- if (targets && (targets->GetEntries() > 1 || targets->GetEntries()==0) ) {
+ if (targets && (targets->GetEntriesFast() > 1 || targets->IsEmpty()) ) {
return kTRUE;
}
if (targets && name != targets->UncheckedAt(0)->GetName() ) {
@@ -525,11 +525,11 @@ Bool_t TSchemaRuleSet::TMatches::HasRuleWithTarget( const TString& name, Bool_t
if( rule->HasTarget( name ) ) {
if (willset) {
const TObjArray *targets = rule->GetTarget();
- if (targets && (targets->GetEntries() > 1 || targets->GetEntries()==0) ) {
+ if (targets && (targets->GetEntriesFast() > 1 || targets->IsEmpty()) ) {
return kTRUE;
}
const TObjArray *sources = rule->GetSource();
- if (sources && (sources->GetEntries() > 1 || sources->GetEntries()==0) ) {
+ if (sources && (sources->GetEntriesFast() > 1 || sources->IsEmpty()) ) {
return kTRUE;
}
if (sources && name != sources->UncheckedAt(0)->GetName() ) {
diff --git a/core/metacling/src/TCling.cxx b/core/metacling/src/TCling.cxx
index c7fd3c78707da488ce80ef29082c444d8456d27b..af2b8a2ba55bad009f8cdb5dcf0bd3f9051d39cb 100644
--- a/core/metacling/src/TCling.cxx
+++ b/core/metacling/src/TCling.cxx
@@ -6172,7 +6172,7 @@ UInt_t TCling::AutoParseImplRecurse(const char *cls, bool topLevel)
clang::DeclContext* previousScopeAsContext = fInterpreter->getCI()->getASTContext().getTranslationUnitDecl();
if (TClassEdit::IsStdClass(cls + offset))
previousScopeAsContext = fInterpreter->getSema().getStdNamespace();
- auto nTokens = tokens->GetEntries();
+ auto nTokens = tokens->GetEntriesFast();
for (Int_t tk = 0; tk < nTokens; ++tk) {
auto scopeObj = tokens->UncheckedAt(tk);
auto scopeName = ((TObjString*) scopeObj)->String().Data();
diff --git a/io/io/inc/TStreamerInfo.h b/io/io/inc/TStreamerInfo.h
index 7d0c7ca950bea2d36ef481a6d5db26acb70df7c3..73dff23b18eca49478b3409d7d26a55b58e9749e 100644
--- a/io/io/inc/TStreamerInfo.h
+++ b/io/io/inc/TStreamerInfo.h
@@ -219,7 +219,7 @@ public:
TStreamerInfoActions::TActionSequence *GetWriteObjectWiseActions() { return fWriteObjectWise; }
TStreamerInfoActions::TActionSequence *GetWriteTextActions() { return fWriteText; }
Int_t GetNdata() const {return fNdata;}
- Int_t GetNelement() const { return fElements->GetEntries(); }
+ Int_t GetNelement() const { return fElements->GetEntriesFast(); }
Int_t GetNumber() const {return fNumber;}
Int_t GetLength(Int_t id) const {return fComp[id].fLength;}
ULong_t GetMethod(Int_t id) const {return fComp[id].fMethod;}
diff --git a/io/io/src/TArchiveFile.cxx b/io/io/src/TArchiveFile.cxx
index 5848640f8828ca87cd50cae01f08562ba36c1211..ece2b54b9e6dfc1523363fb694234bf70b27468f 100644
--- a/io/io/src/TArchiveFile.cxx
+++ b/io/io/src/TArchiveFile.cxx
@@ -159,7 +159,7 @@ Bool_t TArchiveFile::ParseUrl(const char *url, TString &archive, TString &member
// FIXME: hard coded for "zip" archive format
TString urloptions = u.GetOptions();
TObjArray *objOptions = urloptions.Tokenize("&");
- for (Int_t n = 0; n < objOptions->GetEntries(); n++) {
+ for (Int_t n = 0; n < objOptions->GetEntriesFast(); n++) {
TString loption = ((TObjString*)objOptions->At(n))->GetName();
TObjArray *objTags = loption.Tokenize("=");
diff --git a/io/io/src/TStreamerInfo.cxx b/io/io/src/TStreamerInfo.cxx
index 28ddfac0e001736c99923667e218b6f3302e8408..820fb4abb24bee88df0b46697695aa2d18cd0849 100644
--- a/io/io/src/TStreamerInfo.cxx
+++ b/io/io/src/TStreamerInfo.cxx
@@ -730,7 +730,7 @@ void TStreamerInfo::BuildCheck(TFile *file /* = 0 */, Bool_t load /* = kTRUE */)
// Case of a custom collection (the user provided a CollectionProxy
// for a class that is not an STL collection).
- if (GetElements()->GetEntries() == 1) {
+ if (GetElements()->GetEntriesFast() == 1) {
TObject *element = GetElements()->UncheckedAt(0);
Bool_t isstl = element && strcmp("This",element->GetName())==0;
if (isstl) {
@@ -791,7 +791,7 @@ void TStreamerInfo::BuildCheck(TFile *file /* = 0 */, Bool_t load /* = kTRUE */)
const TObjArray *array = fClass->GetStreamerInfos();
TStreamerInfo* info = 0;
- if (fClass->TestBit(TClass::kIsEmulation) && array->GetEntries()==0) {
+ if (fClass->TestBit(TClass::kIsEmulation) && array->IsEmpty()) {
// We have an emulated class that has no TStreamerInfo, this
// means it was created to insert a (default) rule. Consequently
// the error message about the missing dictionary was not printed.
@@ -802,7 +802,7 @@ void TStreamerInfo::BuildCheck(TFile *file /* = 0 */, Bool_t load /* = kTRUE */)
// Case of a custom collection (the user provided a CollectionProxy
// for a class that is not an STL collection).
- if (GetElements()->GetEntries() == 1) {
+ if (GetElements()->GetEntriesFast() == 1) {
TObject *element = GetElements()->UncheckedAt(0);
Bool_t isstl = element && strcmp("This",element->GetName())==0;
if (isstl && !fClass->GetCollectionProxy()) {
@@ -1256,7 +1256,7 @@ void TStreamerInfo::BuildEmulated(TFile *file)
fClassVersion = -1;
fCheckSum = 2001;
TObjArray *elements = GetElements();
- Int_t ndata = elements ? elements->GetEntries() : 0;
+ Int_t ndata = elements ? elements->GetEntriesFast() : 0;
for (Int_t i=0;i < ndata;i++) {
TStreamerElement *element = (TStreamerElement*)elements->UncheckedAt(i);
if (!element) break;
@@ -1575,14 +1575,14 @@ namespace {
return nullptr;
}
TVirtualStreamerInfo *info = current->GetValueClass()->GetStreamerInfo();
- if (info->GetElements()->GetEntries() != 2) {
+ if (info->GetElements()->GetEntriesFast() != 2) {
return oldClass;
}
TStreamerElement *f = (TStreamerElement*) info->GetElements()->At(0);
TStreamerElement *s = (TStreamerElement*) info->GetElements()->At(1);
info = old->GetValueClass()->GetStreamerInfo();
- assert(info->GetElements()->GetEntries() == 2);
+ assert(info->GetElements()->GetEntriesFast() == 2);
TStreamerElement *of = (TStreamerElement*) info->GetElements()->At(0);
TStreamerElement *os = (TStreamerElement*) info->GetElements()->At(1);
@@ -1747,7 +1747,7 @@ void TStreamerInfo::BuildOld()
int nBaze = 0;
- if ((fElements->GetEntries() == 1) && !strcmp(fElements->At(0)->GetName(), "This")) {
+ if ((fElements->GetEntriesFast() == 1) && !strcmp(fElements->At(0)->GetName(), "This")) {
if (fClass->GetCollectionProxy()) {
element = (TStreamerElement*)next();
element->SetNewType( element->GetType() );
@@ -2774,7 +2774,7 @@ TObject *TStreamerInfo::Clone(const char *newname) const
TStreamerInfo *newinfo = (TStreamerInfo*)TNamed::Clone(newname);
if (newname && newname[0] && fName != newname) {
TObjArray *newelems = newinfo->GetElements();
- Int_t ndata = newelems->GetEntries();
+ Int_t ndata = newelems->GetEntriesFast();
for(Int_t i = 0; i < ndata; ++i) {
TObject *element = newelems->UncheckedAt(i);
if (element->IsA() == TStreamerLoop::Class()) {
@@ -3155,7 +3155,7 @@ void TStreamerInfo::ForceWriteInfo(TFile* file, Bool_t force)
if (fClass==0) {
// Build or BuildCheck has not been called yet.
// Let's use another means of checking.
- if (fElements && fElements->GetEntries()==1 && strcmp("This",fElements->UncheckedAt(0)->GetName())==0) {
+ if (fElements && fElements->GetEntriesFast()==1 && strcmp("This",fElements->UncheckedAt(0)->GetName())==0) {
// We are an STL collection.
return;
}
@@ -3585,7 +3585,7 @@ void TStreamerInfo::GenerateDeclaration(FILE *fp, FILE *sfp, const TList *subCla
return;
}
- Bool_t needGenericTemplate = fElements==0 || fElements->GetEntries() == 0;
+ Bool_t needGenericTemplate = fElements==0 || fElements->IsEmpty();
Bool_t isTemplate = kFALSE;
const char *clname = GetName();
TString template_protoname;
@@ -3951,7 +3951,7 @@ Int_t TStreamerInfo::GenerateHeaderFile(const char *dirname, const TList *subCla
}
}
}
- Bool_t needGenericTemplate = isTemplate && (fElements==0 || fElements->GetEntries()==0);
+ Bool_t needGenericTemplate = isTemplate && (fElements==0 || fElements->IsEmpty());
if (gDebug) printf("generating code for class %s\n",GetName());
@@ -4518,7 +4518,7 @@ void TStreamerInfo::InsertArtificialElements(std::vector<const ROOT::TSchemaRule
newel->SetReadRawFunc( rule->GetReadRawFunctionPointer() );
toAdd.push_back(newel);
} else {
- toAdd.reserve(rule->GetTarget()->GetEntries());
+ toAdd.reserve(rule->GetTarget()->GetEntriesFast());
TObjString * objstr = (TObjString*)(rule->GetTarget()->At(0));
if (objstr) {
TString newName = objstr->String();
@@ -4536,7 +4536,7 @@ void TStreamerInfo::InsertArtificialElements(std::vector<const ROOT::TSchemaRule
// This would be a completely new member (so it would need to be cached)
// TOBEDONE
}
- for(Int_t other = 1; other < rule->GetTarget()->GetEntries(); ++other) {
+ for(Int_t other = 1; other < rule->GetTarget()->GetEntriesFast(); ++other) {
objstr = (TObjString*)(rule->GetTarget()->At(other));
if (objstr) {
newName = objstr->String();
diff --git a/io/io/src/TStreamerInfoActions.cxx b/io/io/src/TStreamerInfoActions.cxx
index 429a0da185374d659e85b96748ca9557128ad8ed..5681883825cfca0378b3121d709bde81d6c5edfc 100644
--- a/io/io/src/TStreamerInfoActions.cxx
+++ b/io/io/src/TStreamerInfoActions.cxx
@@ -3003,7 +3003,7 @@ void TStreamerInfo::Compile()
assert(fComp == 0 && fCompFull == 0 && fCompOpt == 0);
- Int_t ndata = fElements->GetEntries();
+ Int_t ndata = fElements->GetEntriesFast();
if (fReadObjectWise) fReadObjectWise->fActions.clear();
@@ -3894,7 +3894,7 @@ TStreamerInfoActions::TActionSequence *TStreamerInfoActions::TActionSequence::Cr
TStreamerInfo *sinfo = static_cast<TStreamerInfo*>(info);
- UInt_t ndata = info->GetElements()->GetEntries();
+ UInt_t ndata = info->GetElements()->GetEntriesFast();
TStreamerInfoActions::TActionSequence *sequence = new TStreamerInfoActions::TActionSequence(info,ndata);
if (IsDefaultVector(proxy))
{
@@ -4009,7 +4009,7 @@ TStreamerInfoActions::TActionSequence *TStreamerInfoActions::TActionSequence::Cr
return new TStreamerInfoActions::TActionSequence(0,0);
}
- UInt_t ndata = info->GetElements()->GetEntries();
+ UInt_t ndata = info->GetElements()->GetEntriesFast();
TStreamerInfo *sinfo = static_cast<TStreamerInfo*>(info);
TStreamerInfoActions::TActionSequence *sequence = new TStreamerInfoActions::TActionSequence(info,ndata);
diff --git a/tree/tree/src/TBranch.cxx b/tree/tree/src/TBranch.cxx
index 5fed8a7ee3c7021db8c57cb0f38e792f24c61939..5f14ce12cbfcca339648232f5d1131b05e4fcf51 100644
--- a/tree/tree/src/TBranch.cxx
+++ b/tree/tree/src/TBranch.cxx
@@ -1159,7 +1159,7 @@ Int_t TBranch::FlushBaskets()
Int_t TBranch::FlushOneBasket(UInt_t ibasket)
{
Int_t nbytes = 0;
- if (fDirectory && fBaskets.GetEntries()) {
+ if (fDirectory && fBaskets.GetEntriesFast()) {
TBasket *basket = (TBasket*)fBaskets.UncheckedAt(ibasket);
if (basket) {
diff --git a/tree/tree/src/TBranchElement.cxx b/tree/tree/src/TBranchElement.cxx
index 2f255fd0751c439a31bc44b5fda50b836e5a9077..e6331d1e9ac88931cbb7f807cb5f95698b719516 100644
--- a/tree/tree/src/TBranchElement.cxx
+++ b/tree/tree/src/TBranchElement.cxx
@@ -1141,10 +1141,12 @@ void TBranchElement::BuildTitle(const char* name)
{
TString branchname;
- Int_t nbranches = fBranches.GetEntries();
+ Int_t nbranches = fBranches.GetEntriesFast();
for (Int_t i = 0; i < nbranches; ++i) {
TBranchElement* bre = (TBranchElement*) fBranches.At(i);
+ if (!bre)
+ continue;
if (fType == 3) {
bre->SetType(31);
} else if (fType == 4) {
@@ -3233,7 +3235,7 @@ void TBranchElement::InitializeOffsets()
{
Int_t streamerType = subBranchElement->GetType();
if (streamerType > TStreamerInfo::kObject
- && subBranch->GetListOfBranches()->GetEntries()==0
+ && subBranch->GetListOfBranches()->GetEntriesFast()==0
&& CanSelfReference(subBranchElement->GetClass()))
{
subBranch->SetBit(kBranchAny);
diff --git a/tree/tree/src/TTreeCache.cxx b/tree/tree/src/TTreeCache.cxx
index 4545e3dfbd773718d472fe3588b5998dce8b46aa..fae1b3156f35dcbf027fbcb274109959fc347400 100644
--- a/tree/tree/src/TTreeCache.cxx
+++ b/tree/tree/src/TTreeCache.cxx
@@ -314,7 +314,7 @@ TTreeCache::TTreeCache(TTree *tree, Int_t buffersize)
fBrNames(new TList), fTree(tree), fPrefillType(GetConfiguredPrefillType())
{
fEntryNext = fEntryMin + fgLearnEntries;
- Int_t nleaves = tree->GetListOfLeaves()->GetEntries();
+ Int_t nleaves = tree->GetListOfLeaves()->GetEntriesFast();
fBranches = new TObjArray(nleaves);
}
diff --git a/tree/tree/src/TTreeCloner.cxx b/tree/tree/src/TTreeCloner.cxx
index 98618b8ad7c6c357b704d000f9df146710d040c6..60f6ec7259e9bfa399de440b99436a1c12dab0e4 100644
--- a/tree/tree/src/TTreeCloner.cxx
+++ b/tree/tree/src/TTreeCloner.cxx
@@ -134,8 +134,8 @@ TTreeCloner::TTreeCloner(TTree *from, TTree *to, TDirectory *newdirectory, Optio
fToDirectory(newdirectory),
fToFile(fToDirectory ? fToDirectory->GetFile() : nullptr),
fMethod(method),
- fFromBranches( from ? from->GetListOfLeaves()->GetEntries()+1 : 0),
- fToBranches( to ? to->GetListOfLeaves()->GetEntries()+1 : 0),
+ fFromBranches( from ? from->GetListOfLeaves()->GetEntriesFast()+1 : 0),
+ fToBranches( to ? to->GetListOfLeaves()->GetEntriesFast()+1 : 0),
fMaxBaskets(CollectBranches()),
fBasketBranchNum(new UInt_t[fMaxBaskets]),
fBasketNum(new UInt_t[fMaxBaskets]),
@@ -264,7 +264,7 @@ void TTreeCloner::CloseOutWriteBaskets()
if (IsInPlace())
return;
- for(Int_t i=0; i<fToBranches.GetEntries(); ++i) {
+ for(Int_t i=0; i<fToBranches.GetEntriesFast(); ++i) {
TBranch *to = (TBranch*)fToBranches.UncheckedAt(i);
to->FlushOneBasket(to->GetWriteBasket());
}
@@ -286,8 +286,8 @@ UInt_t TTreeCloner::CollectBranches(TBranch *from, TBranch *to) {
numBaskets += CollectBranches(fromclones->fBranchCount, toclones->fBranchCount);
} else if (from->InheritsFrom(TBranchElement::Class())) {
- Int_t nb = from->GetListOfLeaves()->GetEntries();
- Int_t fnb = to->GetListOfLeaves()->GetEntries();
+ Int_t nb = from->GetListOfLeaves()->GetEntriesFast();
+ Int_t fnb = to->GetListOfLeaves()->GetEntriesFast();
if (nb != fnb && (nb == 0 || fnb == 0)) {
// We might be in the case where one branch is split
// while the other is not split. We must reject this match.
@@ -314,8 +314,8 @@ UInt_t TTreeCloner::CollectBranches(TBranch *from, TBranch *to) {
if (fromelem->fMaximum > toelem->fMaximum) toelem->fMaximum = fromelem->fMaximum;
} else {
- Int_t nb = from->GetListOfLeaves()->GetEntries();
- Int_t fnb = to->GetListOfLeaves()->GetEntries();
+ Int_t nb = from->GetListOfLeaves()->GetEntriesFast();
+ Int_t fnb = to->GetListOfLeaves()->GetEntriesFast();
if (nb != fnb) {
fWarningMsg.Form("The export branch and the import branch (%s) do not have the same number of leaves (%d vs %d)",
from->GetName(), fnb, nb);
@@ -366,8 +366,8 @@ UInt_t TTreeCloner::CollectBranches(TObjArray *from, TObjArray *to)
{
// Since this is called from the constructor, this can not be a virtual function
- Int_t fnb = from->GetEntries();
- Int_t tnb = to->GetEntries();
+ Int_t fnb = from->GetEntriesFast();
+ Int_t tnb = to->GetEntriesFast();
if (!fnb || !tnb) {
return 0;
}
@@ -450,7 +450,7 @@ UInt_t TTreeCloner::CollectBranches()
void TTreeCloner::CollectBaskets()
{
- UInt_t len = fFromBranches.GetEntries();
+ UInt_t len = fFromBranches.GetEntriesFast();
for(UInt_t i=0,bi=0; i<len; ++i) {
TBranch *from = (TBranch*)fFromBranches.UncheckedAt(i);
@@ -516,11 +516,11 @@ void TTreeCloner::CopyMemoryBaskets()
return;
TBasket *basket = 0;
- for(Int_t i=0; i<fToBranches.GetEntries(); ++i) {
+ for(Int_t i=0; i<fToBranches.GetEntriesFast(); ++i) {
TBranch *from = (TBranch*)fFromBranches.UncheckedAt( i );
TBranch *to = (TBranch*)fToBranches.UncheckedAt( i );
- basket = from->GetListOfBaskets()->GetEntries() ? from->GetBasket(from->GetWriteBasket()) : 0;
+ basket = (!from->GetListOfBaskets()->IsEmpty()) ? from->GetBasket(from->GetWriteBasket()) : 0;
if (basket) {
basket = (TBasket*)basket->Clone();
basket->SetBranch(to);