From 2356f2b5d9bb6ce5fb9ae685119caede6b61e65f Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 3 Nov 2015 01:20:44 +0000 Subject: [PATCH] This never returns end(), simplify to use Child instead of iterator. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251876 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Object/Archive.h | 2 +- lib/Object/Archive.cpp | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/llvm/Object/Archive.h b/include/llvm/Object/Archive.h index a2797ad2d8e..bd1be994e18 100644 --- a/include/llvm/Object/Archive.h +++ b/include/llvm/Object/Archive.h @@ -142,7 +142,7 @@ public: , SymbolIndex(symi) , StringIndex(stri) {} StringRef getName() const; - ErrorOr getMember() const; + ErrorOr getMember() const; Symbol getNext() const; }; diff --git a/lib/Object/Archive.cpp b/lib/Object/Archive.cpp index d50a69951e1..5ac91f23035 100644 --- a/lib/Object/Archive.cpp +++ b/lib/Object/Archive.cpp @@ -402,7 +402,7 @@ StringRef Archive::Symbol::getName() const { return Parent->getSymbolTable().begin() + StringIndex; } -ErrorOr Archive::Symbol::getMember() const { +ErrorOr Archive::Symbol::getMember() const { const char *Buf = Parent->getSymbolTable().begin(); const char *Offsets = Buf; if (Parent->kind() == K_MIPS64) @@ -447,8 +447,7 @@ ErrorOr Archive::Symbol::getMember() const { } const char *Loc = Parent->getData().begin() + Offset; - child_iterator Iter(Child(Parent, Loc)); - return Iter; + return Child(Parent, Loc); } Archive::Symbol Archive::Symbol::getNext() const { -- 2.34.1