diff --git a/src/apps/debugger/elf/ElfFile.cpp b/src/apps/debugger/elf/ElfFile.cpp index 1d84fc52f2..abf1147861 100644 --- a/src/apps/debugger/elf/ElfFile.cpp +++ b/src/apps/debugger/elf/ElfFile.cpp @@ -275,11 +275,9 @@ ElfFile::Init(const char* fileName) ElfSection* ElfFile::GetSection(const char* name) { - for (SectionList::Iterator it = fSections.GetIterator(); - ElfSection* section = it.Next();) { - if (strcmp(section->Name(), name) == 0) - return section->Load() == B_OK ? section : NULL; - } + ElfSection* section = FindSection(name); + if (section != NULL && section->Load() == B_OK) + return section; return NULL; }