From efd2d5e1c48e9e530d2323123d28120f50dfed76 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Fri, 4 Nov 2011 13:52:17 +0000 Subject: [PATCH] Simplify code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143695 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Object/Archive.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Object/Archive.cpp b/lib/Object/Archive.cpp index a1bd8b6c923..8bdab16c04d 100644 --- a/lib/Object/Archive.cpp +++ b/lib/Object/Archive.cpp @@ -242,10 +242,9 @@ error_code Archive::Symbol::getMember(child_iterator &Result) const { Archive::Symbol Archive::Symbol::getNext() const { Symbol t(*this); - const char *buf = Parent->SymbolTable->getBuffer()->getBufferStart(); - buf += t.StringIndex; - while (*buf++); // Go to one past next null. - t.StringIndex = buf - Parent->SymbolTable->getBuffer()->getBufferStart(); + // Go to one past next null. + t.StringIndex = + Parent->SymbolTable->getBuffer()->getBuffer().find('\0', t.StringIndex) + 1; ++t.SymbolIndex; return t; }