From 150a371569d100e14a438cd4f89904da24c6cb20 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 13 Feb 2012 23:45:26 +0000 Subject: Don't recalculate the size of the vector each time through the loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150436 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/MachineModuleInfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/CodeGen/MachineModuleInfo.cpp b/lib/CodeGen/MachineModuleInfo.cpp index a7bd0f7e9a..326f147f1a 100644 --- a/lib/CodeGen/MachineModuleInfo.cpp +++ b/lib/CodeGen/MachineModuleInfo.cpp @@ -561,13 +561,13 @@ unsigned MachineModuleInfo::getPersonalityIndex() const { const Function* Personality = NULL; // Scan landing pads. If there is at least one non-NULL personality - use it. - for (unsigned i = 0; i != LandingPads.size(); ++i) + for (unsigned i = 0, e = LandingPads.size(); i != e; ++i) if (LandingPads[i].Personality) { Personality = LandingPads[i].Personality; break; } - for (unsigned i = 0; i < Personalities.size(); ++i) { + for (unsigned i = 0, e = Personalities.size(); i < e; ++i) { if (Personalities[i] == Personality) return i; } -- cgit v1.2.3