================
@@ -508,13 +508,11 @@ class EntityMap : public std::map<std::string, 
SmallVector<Entry, 2>> {
       // Sort contents.
       llvm::sort(H->second);
 
-      // Check whether we've seen this header before.
-      auto KnownH = AllHeaderContents.find(H->first);
-      if (KnownH == AllHeaderContents.end()) {
-        // We haven't seen this header before; record its contents.
-        AllHeaderContents.insert(*H);
+      // Record this header and its contents if we haven't seen it before.
+      auto [KnownH, Inserted] =
+          AllHeaderContents.try_emplace(H->first, H->second);
----------------
nikic wrote:

```suggestion
          AllHeaderContents.insert(*H);
```
Maybe?

https://github.com/llvm/llvm-project/pull/109508
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to