]> granicus.if.org Git - clang/commitdiff
Replace loop with std::any_of, NFC.
authorYaron Keren <yaron.keren@gmail.com>
Mon, 23 Nov 2015 19:28:42 +0000 (19:28 +0000)
committerYaron Keren <yaron.keren@gmail.com>
Mon, 23 Nov 2015 19:28:42 +0000 (19:28 +0000)
Inspired by similar commits from Craig Topper.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253904 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaLookup.cpp

index 1124d989c7e86fd2c8960a881975465de8508878..ab3377a41795b869ee4b8ddda527982e227c0a66 100644 (file)
@@ -1535,12 +1535,8 @@ bool LookupResult::isVisibleSlow(Sema &SemaRef, NamedDecl *D) {
 
   // 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) {