diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-11-04 13:52:17 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-11-04 13:52:17 +0000 |
commit | efd2d5e1c48e9e530d2323123d28120f50dfed76 (patch) | |
tree | a7b665b0a7735948d560e4583a1b115f4cc7394b /lib/Object/Archive.cpp | |
parent | 24c5b368417d80baf4d10e691d4ac2d180fe2156 (diff) |
Simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143695 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object/Archive.cpp')
-rw-r--r-- | lib/Object/Archive.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Object/Archive.cpp b/lib/Object/Archive.cpp index a1bd8b6c92..8bdab16c04 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; } |