Simplify code. No functionality change.

llvm-svn: 165905
This commit is contained in:
Benjamin Kramer 2012-10-14 11:50:50 +00:00
parent c5b0678cf8
commit 66cd0503b8
1 changed files with 4 additions and 10 deletions

View File

@ -430,16 +430,10 @@ public:
void dropAttr() {
if (!HasAttrs) return;
AttrVec &Attrs = getAttrs();
for (unsigned i = 0, e = Attrs.size(); i != e; /* in loop */) {
if (isa<T>(Attrs[i])) {
Attrs.erase(Attrs.begin() + i);
--e;
}
else
++i;
}
if (Attrs.empty())
AttrVec &Vec = getAttrs();
Vec.erase(std::remove_if(Vec.begin(), Vec.end(), isa<T, Attr*>), Vec.end());
if (Vec.empty())
HasAttrs = false;
}