aboutsummaryrefslogtreecommitdiff
path: root/lib/MC/MCContext.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-10-12 20:20:48 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-10-12 20:20:48 +0000
commit18ad76bb9aa1970958c52887eb4a648d1bac0a0e (patch)
treef3fccb352efc2cb9564c4c8554822a26f425dd36 /lib/MC/MCContext.cpp
parentb0786b33fa9090adee9a30796ead7969f948f4cd (diff)
Hoist vector.size() computation out of the loop. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141807 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCContext.cpp')
-rw-r--r--lib/MC/MCContext.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/MC/MCContext.cpp b/lib/MC/MCContext.cpp
index 4ef2cdcc9f..82690ee3b3 100644
--- a/lib/MC/MCContext.cpp
+++ b/lib/MC/MCContext.cpp
@@ -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;
}