From b55d0226b7139648941466d6e6dc08a05e3902e7 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 3 Mar 2014 19:36:27 +0000 Subject: [PATCH] [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 --- clang/lib/Serialization/ModuleManager.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/clang/lib/Serialization/ModuleManager.cpp b/clang/lib/Serialization/ModuleManager.cpp index 201f8fadea61..3513eba86024 100644 --- a/clang/lib/Serialization/ModuleManager.cpp +++ b/clang/lib/Serialization/ModuleManager.cpp @@ -143,11 +143,10 @@ void ModuleManager::removeModules(ModuleIterator first, ModuleIterator last, llvm::SmallPtrSet victimSet(first, last); // Remove any references to the now-destroyed modules. - std::function 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.