https://github.com/kazutakahirata created 
https://github.com/llvm/llvm-project/pull/109373

None

>From 68677c82b0c2d437be7926288249a043e5325ffe Mon Sep 17 00:00:00 2001
From: Kazu Hirata <k...@google.com>
Date: Thu, 19 Sep 2024 09:37:59 -0700
Subject: [PATCH] [clang-tidy] Avoid repeated hash lookups (NFC)

---
 .../clang-tidy/ExpandModularHeadersPPCallbacks.cpp             | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp 
b/clang-tools-extra/clang-tidy/ExpandModularHeadersPPCallbacks.cpp
index 5e2cc207560d33..fef086c5a99d86 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.

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to