aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/ModuleMap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r--clang/lib/Lex/ModuleMap.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp
index 08381d0..6324cdc 100644
--- a/clang/lib/Lex/ModuleMap.cpp
+++ b/clang/lib/Lex/ModuleMap.cpp
@@ -1217,9 +1217,8 @@ void ModuleMap::addHeader(Module *Mod, Module::Header Header,
// FIXME: Should we diagnose if a header is listed twice in the
// same module definition?
auto &HeaderList = Headers[Header.Entry];
- for (auto H : HeaderList)
- if (H == KH)
- return;
+ if (llvm::is_contained(HeaderList, KH))
+ return;
HeaderList.push_back(KH);
Mod->Headers[headerRoleToKind(Role)].push_back(Header);