r253904 - Replace loop with std::any_of, NFC.
Yaron Keren via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 23 11:28:42 PST 2015
Author: yrnkrn
Date: Mon Nov 23 13:28:42 2015
New Revision: 253904
URL: http://llvm.org/viewvc/llvm-project?rev=253904&view=rev
Log:
Replace loop with std::any_of, NFC.
Inspired by similar commits from Craig Topper.
Modified:
cfe/trunk/lib/Sema/SemaLookup.cpp
Modified: cfe/trunk/lib/Sema/SemaLookup.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaLookup.cpp?rev=253904&r1=253903&r2=253904&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaLookup.cpp (original)
+++ cfe/trunk/lib/Sema/SemaLookup.cpp Mon Nov 23 13:28:42 2015
@@ -1535,12 +1535,8 @@ bool LookupResult::isVisibleSlow(Sema &S
// Check whether DeclModule is transitively exported to an import of
// the lookup set.
- for (llvm::DenseSet<Module *>::iterator I = LookupModules.begin(),
- E = LookupModules.end();
- I != E; ++I)
- if ((*I)->isModuleVisible(DeclModule))
- return true;
- return false;
+ return std::any_of(LookupModules.begin(), LookupModules.end(),
+ [=](Module *M) { return M->isModuleVisible(DeclModule); });
}
bool Sema::isVisibleSlow(const NamedDecl *D) {
More information about the cfe-commits
mailing list