Skip to content

Commit c498af7

Browse files
[clang-tidy] Avoid repeated hash lookups (NFC) (#109373)
1 parent 7365b1c commit c498af7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,8 @@ void ExpandModularHeadersPPCallbacks::handleModuleFile(
116116
if (!MF)
117117
return;
118118
// Avoid processing a ModuleFile more than once.
119-
if (VisitedModules.count(MF))
119+
if (!VisitedModules.insert(MF).second)
120120
return;
121-
VisitedModules.insert(MF);
122121

123122
// Visit all the input files of this module and mark them to record their
124123
// contents later.

0 commit comments

Comments
 (0)