llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-modules

Author: Jonas Hahnfeld (hahnjo)

<details>
<summary>Changes</summary>

This also avoids copying the list of `ModuleIDs`.

---
Full diff: https://github.com/llvm/llvm-project/pull/214438.diff


1 Files Affected:

- (modified) clang/lib/Serialization/GlobalModuleIndex.cpp (+2-3) 


``````````diff
diff --git a/clang/lib/Serialization/GlobalModuleIndex.cpp 
b/clang/lib/Serialization/GlobalModuleIndex.cpp
index 3f6b8e68e38f3..6d0678141fa73 100644
--- a/clang/lib/Serialization/GlobalModuleIndex.cpp
+++ b/clang/lib/Serialization/GlobalModuleIndex.cpp
@@ -318,9 +318,8 @@ bool GlobalModuleIndex::lookupIdentifier(StringRef Name, 
HitSet &Hits) {
     return false;
   }
 
-  SmallVector<unsigned, 2> ModuleIDs = *Known;
-  for (unsigned I = 0, N = ModuleIDs.size(); I != N; ++I) {
-    if (ModuleFile *MF = Modules[ModuleIDs[I]].File)
+  for (unsigned ModuleID : *Known) {
+    if (ModuleFile *MF = Modules[ModuleID].File)
       Hits.insert(MF);
   }
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/214438
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to