From be443f53330263ee32345da994149e8c8858cc6d Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Mon, 13 Dec 2010 16:01:52 +0000 Subject: [PATCH] Code duplication cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39827 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/debugger/elf/ElfFile.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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; }