[clang] d8a8cb9 - [Driver] Avoid repeated hash lookups (NFC) (#108676)

via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 13 22:52:26 PDT 2024


Author: Kazu Hirata
Date: 2024-09-13T22:52:23-07:00
New Revision: d8a8cb9a721a2d00d11df09a849356e981ef6b49

URL: https://github.com/llvm/llvm-project/commit/d8a8cb9a721a2d00d11df09a849356e981ef6b49
DIFF: https://github.com/llvm/llvm-project/commit/d8a8cb9a721a2d00d11df09a849356e981ef6b49.diff

LOG: [Driver] Avoid repeated hash lookups (NFC) (#108676)

Added: 
    

Modified: 
    clang/lib/Driver/OffloadBundler.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/OffloadBundler.cpp b/clang/lib/Driver/OffloadBundler.cpp
index a4ab846ed2c57a..aaa4fdf03be1eb 100644
--- a/clang/lib/Driver/OffloadBundler.cpp
+++ b/clang/lib/Driver/OffloadBundler.cpp
@@ -1760,16 +1760,8 @@ Error OffloadBundler::UnbundleArchive() {
 
           // For inserting <CompatibleTarget, list<CodeObject>> entry in
           // OutputArchivesMap.
-          if (!OutputArchivesMap.contains(CompatibleTarget)) {
-
-            std::vector<NewArchiveMember> ArchiveMembers;
-            ArchiveMembers.push_back(NewArchiveMember(MemBufRef));
-            OutputArchivesMap.insert_or_assign(CompatibleTarget,
-                                               std::move(ArchiveMembers));
-          } else {
-            OutputArchivesMap[CompatibleTarget].push_back(
-                NewArchiveMember(MemBufRef));
-          }
+          OutputArchivesMap[CompatibleTarget].push_back(
+              NewArchiveMember(MemBufRef));
         }
       }
 


        


More information about the cfe-commits mailing list