From f895efaa454a1a67b42b3eb1143fec7900c41a6d Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Wed, 12 Oct 2011 20:20:48 +0000 Subject: Hoist vector.size() computation out of the loop. No functionality change. llvm-svn: 141807 --- llvm/lib/MC/MCContext.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/MC/MCContext.cpp') diff --git a/llvm/lib/MC/MCContext.cpp b/llvm/lib/MC/MCContext.cpp index 4ef2cdcc9f5..82690ee3b3e 100644 --- a/llvm/lib/MC/MCContext.cpp +++ b/llvm/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; } -- cgit v1.2.3