2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-07-05 22:35:53 +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:
Lioncash 2019-10-26 21:19:54 -04:00
parent e7b0470f55
commit 293d19cf13

View File

@ -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);
}
}