Hoist vector.size() computation out of the loop. No functionality change.
authorNick Lewycky <nicholas@mxc.ca>
Wed, 12 Oct 2011 20:20:48 +0000 (20:20 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Wed, 12 Oct 2011 20:20:48 +0000 (20:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141807 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCContext.cpp

index 4ef2cdcc9f5f86bd04bb100a8370007d97672adc..82690ee3b3e96712c9cc4ed3b49aa4a220e6a86c 100644 (file)
@@ -279,7 +279,8 @@ unsigned MCContext::GetDwarfFile(StringRef FileName, unsigned FileNumber) {
   } else {
     StringRef Directory = Slash.first;
     Name = Slash.second;
-    for (DirIndex = 0; DirIndex < MCDwarfDirs.size(); DirIndex++) {
+    DirIndex = 0;
+    for (unsigned End = MCDwarfDirs.size(); DirIndex < End; DirIndex++) {
       if (Directory == MCDwarfDirs[DirIndex])
         break;
     }