From 18ad76bb9aa1970958c52887eb4a648d1bac0a0e Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Wed, 12 Oct 2011 20:20:48 +0000 Subject: [PATCH] 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 --- lib/MC/MCContext.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/MC/MCContext.cpp b/lib/MC/MCContext.cpp index 4ef2cdcc9f5..82690ee3b3e 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; } -- 2.34.1