mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-13 19:24:21 +00:00
Improve VarInfo::removeKill() by using std::find instead of linear search.
llvm-svn: 48321
This commit is contained in:
parent
7698bfbe16
commit
0ceb8eb150
@ -102,13 +102,12 @@ public:
|
||||
/// machine instruction. Returns true if there was a kill
|
||||
/// corresponding to this instruction, false otherwise.
|
||||
bool removeKill(MachineInstr *MI) {
|
||||
for (std::vector<MachineInstr*>::iterator i = Kills.begin(),
|
||||
e = Kills.end(); i != e; ++i)
|
||||
if (*i == MI) {
|
||||
Kills.erase(i);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
std::vector<MachineInstr*>::iterator
|
||||
I = std::find(Kills.begin(), Kills.end(), MI);
|
||||
if (I == Kills.end())
|
||||
return false;
|
||||
Kills.erase(I);
|
||||
return true;
|
||||
}
|
||||
|
||||
void dump() const;
|
||||
|
Loading…
Reference in New Issue
Block a user