[llvm-commits] [llvm] r143695 - /llvm/trunk/lib/Object/Archive.cpp

Benjamin Kramer benny.kra at googlemail.com
Fri Nov 4 06:52:17 PDT 2011


Author: d0k
Date: Fri Nov  4 08:52:17 2011
New Revision: 143695

URL: http://llvm.org/viewvc/llvm-project?rev=143695&view=rev
Log:
Simplify code.

Modified:
    llvm/trunk/lib/Object/Archive.cpp

Modified: llvm/trunk/lib/Object/Archive.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/Archive.cpp?rev=143695&r1=143694&r2=143695&view=diff
==============================================================================
--- llvm/trunk/lib/Object/Archive.cpp (original)
+++ llvm/trunk/lib/Object/Archive.cpp Fri Nov  4 08:52:17 2011
@@ -242,10 +242,9 @@
 
 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;
 }





More information about the llvm-commits mailing list