Skip to content
Snippets Groups Projects
Commit 9af97140 authored by Fons Rademakers's avatar Fons Rademakers
Browse files

use TString== instead of strcmp().

git-svn-id: http://root.cern.ch/svn/root/trunk@5014 27541ba8-7e3a-0410-8455-c3a389f83636
parent 27640443
No related branches found
No related tags found
No related merge requests found
// @(#)root/cont:$Name: $:$Id: TCollection.cxx,v 1.16 2002/02/23 16:01:44 rdm Exp $ // @(#)root/cont:$Name: $:$Id: TCollection.cxx,v 1.17 2002/05/30 19:43:06 brun Exp $
// Author: Fons Rademakers 13/08/95 // Author: Fons Rademakers 13/08/95
/************************************************************************* /*************************************************************************
...@@ -225,8 +225,8 @@ Bool_t TCollection::IsArgNull(const char *where, const TObject *obj) const ...@@ -225,8 +225,8 @@ Bool_t TCollection::IsArgNull(const char *where, const TObject *obj) const
void TCollection::ls(Option_t *option) const void TCollection::ls(Option_t *option) const
{ {
// List (ls) all objects in this collection. // List (ls) all objects in this collection.
// wildcarding supported, eg option="xxx*" lists only objects // Wildcarding supported, eg option="xxx*" lists only objects
// with names xxx* // with names xxx*.
TRegexp re(option,kTRUE); TRegexp re(option,kTRUE);
TIter next(this); TIter next(this);
...@@ -237,7 +237,7 @@ void TCollection::ls(Option_t *option) const ...@@ -237,7 +237,7 @@ void TCollection::ls(Option_t *option) const
while ((object = next())) { while ((object = next())) {
if (star) { if (star) {
TString s = object->GetName(); TString s = object->GetName();
if (strcmp(option,object->GetName()) && s.Index(re) == kNPOS) continue; if (s != option && s.Index(re) == kNPOS) continue;
} }
object->ls(option); object->ls(option);
} }
...@@ -256,17 +256,17 @@ void TCollection::Paint(Option_t *option) ...@@ -256,17 +256,17 @@ void TCollection::Paint(Option_t *option)
void TCollection::Print(Option_t *option) const void TCollection::Print(Option_t *option) const
{ {
// Print all objects in this collection. // Print all objects in this collection.
// wildcarding supported, eg option="xxx*" prints only objects // Wildcarding supported, eg option="xxx*" prints only objects
// with names xxx* // with names xxx*.
TRegexp re(option,kTRUE); TRegexp re(option,kTRUE);
Int_t nch = strlen(option);
TIter next(this); TIter next(this);
TObject *object; TObject *object;
Int_t nch = strlen(option);
while ((object = next())) { while ((object = next())) {
TString s = object->GetName(); TString s = object->GetName();
if (nch && strcmp(option,object->GetName()) && s.Index(re) == kNPOS) continue; if (nch && s != option && s.Index(re) == kNPOS) continue;
object->Print(option); object->Print(option);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment