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)); } } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits