mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-10 21:07:42 +00:00
CCharLayoutInfo: std::move std::string instance in CCharLayoutInfo constructor
Avoids performing a copy (and by extension also avoids redundant allocations).
This commit is contained in:
@@ -48,10 +48,11 @@ CCharLayoutNode::CCharLayoutNode(CInputStream& in) : x0_boneMap(in.readUint32Big
|
||||
}
|
||||
|
||||
CCharLayoutInfo::CCharLayoutInfo(CInputStream& in) : x0_node(std::make_shared<CCharLayoutNode>(in)), x8_segIdList(in) {
|
||||
atUint32 mapCount = in.readUint32Big();
|
||||
const atUint32 mapCount = in.readUint32Big();
|
||||
|
||||
for (atUint32 i = 0; i < mapCount; ++i) {
|
||||
std::string key = in.readString();
|
||||
x18_segIdMap.emplace(key, in);
|
||||
x18_segIdMap.emplace(std::move(key), in);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user