mirror of https://github.com/AxioDL/metaforce.git
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:
parent
e7b0470f55
commit
293d19cf13
|
@ -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) {
|
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) {
|
for (atUint32 i = 0; i < mapCount; ++i) {
|
||||||
std::string key = in.readString();
|
std::string key = in.readString();
|
||||||
x18_segIdMap.emplace(key, in);
|
x18_segIdMap.emplace(std::move(key), in);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue