Simplify code.

llvm-svn: 143695
This commit is contained in:
Benjamin Kramer 2011-11-04 13:52:17 +00:00
parent 110f5039b1
commit 4246ca4021
1 changed files with 3 additions and 4 deletions

View File

@ -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;
}