forked from OSchip/llvm-project
Switch to an idiomatic C++ erase/remove for this loop, and fix a bug in the
process (I don't believe it's possible to write a testcase for the bug with a non-checking STL implementation). llvm-svn: 203042
This commit is contained in:
parent
2a9d318e4a
commit
bb29e518c8
|
@ -1684,9 +1684,11 @@ void ASTReader::removeOverriddenMacros(IdentifierInfo *II,
|
|||
}
|
||||
|
||||
// If this macro is already in our list of conflicts, remove it from there.
|
||||
for (unsigned AI = 0, AN = Ambig.size(); AI != AN; ++AI)
|
||||
if (Ambig[AI]->getInfo()->getOwningModuleID() == OwnerID)
|
||||
Ambig.erase(Ambig.begin() + AI);
|
||||
Ambig.erase(
|
||||
std::remove_if(Ambig.begin(), Ambig.end(), [&](DefMacroDirective *MD) {
|
||||
return MD->getInfo()->getOwningModuleID() == OwnerID;
|
||||
}),
|
||||
Ambig.end());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue