diff --git a/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp b/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp index 5e2cc207560d..fef086c5a99d 100644 --- a/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp +++ b/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp @@ -116,9 +116,8 @@ void ExpandModularHeadersPPCallbacks::handleModuleFile( if (!MF) return; // Avoid processing a ModuleFile more than once. - if (VisitedModules.count(MF)) + if (!VisitedModules.insert(MF).second) return; - VisitedModules.insert(MF); // Visit all the input files of this module and mark them to record their // contents later.