From c51c607dfc6388050ed1381a32089cd08a36ff9a Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sat, 22 Jul 2023 00:00:57 -0700 Subject: [VirtualFileSystem] Use std::map::emplace --- llvm/lib/Support/VirtualFileSystem.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/Support/VirtualFileSystem.cpp') diff --git a/llvm/lib/Support/VirtualFileSystem.cpp b/llvm/lib/Support/VirtualFileSystem.cpp index 25d057bd9c84..d381d79fba96 100644 --- a/llvm/lib/Support/VirtualFileSystem.cpp +++ b/llvm/lib/Support/VirtualFileSystem.cpp @@ -749,8 +749,7 @@ public: } InMemoryNode *addChild(StringRef Name, std::unique_ptr Child) { - return Entries.insert(make_pair(Name.str(), std::move(Child))) - .first->second.get(); + return Entries.emplace(Name, std::move(Child)).first->second.get(); } using const_iterator = decltype(Entries)::const_iterator; -- cgit v1.2.3