[VirtualFileSystem] Use std::map::emplace

This commit is contained in:
Fangrui Song 2023-07-22 00:00:57 -07:00
parent 0318123f67
commit c51c607dfc

View File

@ -749,8 +749,7 @@ public:
}
InMemoryNode *addChild(StringRef Name, std::unique_ptr<InMemoryNode> 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;