From: Yaron Keren Date: Mon, 23 Nov 2015 19:28:42 +0000 (+0000) Subject: Replace loop with std::any_of, NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e74abb7de829051f037d567d1cb3221a2bd5aa70;p=clang Replace loop with std::any_of, NFC. Inspired by similar commits from Craig Topper. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253904 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index 1124d989c7..ab3377a417 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -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::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) {