forked from OSchip/llvm-project
[C++11] Remove a now unnecessary use of std::function for a remove_if
predicate. The wrapper used by SetVector was erroneously requiring an adaptable predicate. It has been fixed and we really don't want to require an indirect call for every predicate evaluation. llvm-svn: 202744
This commit is contained in:
parent
23f16b1ceb
commit
b55d0226b7
|
@ -143,11 +143,10 @@ void ModuleManager::removeModules(ModuleIterator first, ModuleIterator last,
|
|||
llvm::SmallPtrSet<ModuleFile *, 4> victimSet(first, last);
|
||||
|
||||
// Remove any references to the now-destroyed modules.
|
||||
std::function<bool(ModuleFile *)> checkInSet = [&](ModuleFile *MF) {
|
||||
return victimSet.count(MF);
|
||||
};
|
||||
for (unsigned i = 0, n = Chain.size(); i != n; ++i) {
|
||||
Chain[i]->ImportedBy.remove_if(checkInSet);
|
||||
Chain[i]->ImportedBy.remove_if([&](ModuleFile *MF) {
|
||||
return victimSet.count(MF);
|
||||
});
|
||||
}
|
||||
|
||||
// Delete the modules and erase them from the various structures.
|
||||
|
|
Loading…
Reference in New Issue