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 | 4246ca4021efe884aa5002b339aa418c9a46e1b0 (patch) | |
tree | 75084a9f033f7b332a027a96b898b6be78c70ddc /llvm | |
parent | 110f5039b1d1d1865c898954c4f7638f3ac8dc80 (diff) | |
download | bcm5719-llvm-4246ca4021efe884aa5002b339aa418c9a46e1b0.tar.gz bcm5719-llvm-4246ca4021efe884aa5002b339aa418c9a46e1b0.zip |
Simplify code.
llvm-svn: 143695
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/lib/Object/Archive.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Object/Archive.cpp b/llvm/lib/Object/Archive.cpp index a1bd8b6c923..8bdab16c04d 100644 --- a/llvm/lib/Object/Archive.cpp +++ b/llvm/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; } |