[clang-tidy] Avoid repeated hash lookups (NFC) (#109373)

This commit is contained in:
Kazu Hirata 2024-09-20 07:59:08 -07:00 committed by GitHub
parent 7365b1c7bb
commit c498af71d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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.