[TextAPI] Use MapVector::try_emplace (NFC) (#143564)
- try_emplace(Key) is shorter than insert({Key, nullptr}). - try_emplace performs value initialization without value parameters. - We overwrite values on successful insertion anyway.
This commit is contained in:
parent
30dd652c29
commit
9bda38f8d9
@ -259,7 +259,7 @@ ObjCInterfaceRecord::getObjCCategories() const {
|
||||
|
||||
ObjCIVarRecord *ObjCContainerRecord::addObjCIVar(StringRef IVar,
|
||||
RecordLinkage Linkage) {
|
||||
auto Result = IVars.insert({IVar, nullptr});
|
||||
auto Result = IVars.try_emplace(IVar);
|
||||
if (Result.second)
|
||||
Result.first->second = std::make_unique<ObjCIVarRecord>(IVar, Linkage);
|
||||
return Result.first->second.get();
|
||||
|
Loading…
x
Reference in New Issue
Block a user