Don't recalculate the size of the vector each time through the loop.

llvm-svn: 150436
This commit is contained in:
Bill Wendling 2012-02-13 23:45:26 +00:00
parent adcec49f96
commit 05f7380b33
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}