[llvm] a99bf0f - [llvm-readtapi] Simplify code with StringMap::operator[] (NFC) (#112824)

via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 18 08:40:08 PDT 2024


Author: Kazu Hirata
Date: 2024-10-18T08:40:05-07:00
New Revision: a99bf0f6c98e8e2927ce7cecbb35b962285e1675

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

LOG: [llvm-readtapi] Simplify code with StringMap::operator[] (NFC) (#112824)

Added: 
    

Modified: 
    llvm/tools/llvm-readtapi/llvm-readtapi.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-readtapi/llvm-readtapi.cpp b/llvm/tools/llvm-readtapi/llvm-readtapi.cpp
index 6e42ed76949ff5..1d740109d5b679 100644
--- a/llvm/tools/llvm-readtapi/llvm-readtapi.cpp
+++ b/llvm/tools/llvm-readtapi/llvm-readtapi.cpp
@@ -325,8 +325,8 @@ static void stubifyDirectory(const StringRef InputPath, Context &Ctx) {
         continue;
       }
 
-      auto itr = SymLinks.insert({LinkTarget.c_str(), std::vector<SymLink>()});
-      itr.first->second.emplace_back(LinkSrc.str(), std::string(SymPath.str()));
+      SymLinks[LinkTarget.c_str()].emplace_back(LinkSrc.str(),
+                                                std::string(SymPath.str()));
 
       continue;
     }


        


More information about the llvm-commits mailing list