mirror of https://github.com/AxioDL/metaforce.git
CAnimSourceReader: Make use of emplace() where applicable
Same behavior, but with less code.
This commit is contained in:
parent
df4487bae8
commit
9541ed1919
|
@ -27,27 +27,33 @@ CCharAnimTime CAnimSourceInfo::GetAnimationDuration() const { return x4_token->G
|
||||||
std::set<std::pair<std::string, s32>> CAnimSourceReaderBase::GetUniqueParticlePOIs() const {
|
std::set<std::pair<std::string, s32>> CAnimSourceReaderBase::GetUniqueParticlePOIs() const {
|
||||||
const std::vector<CParticlePOINode>& particleNodes = x4_sourceInfo->GetParticlePOIStream();
|
const std::vector<CParticlePOINode>& particleNodes = x4_sourceInfo->GetParticlePOIStream();
|
||||||
std::set<std::pair<std::string, s32>> ret;
|
std::set<std::pair<std::string, s32>> ret;
|
||||||
for (const CParticlePOINode& node : particleNodes)
|
for (const CParticlePOINode& node : particleNodes) {
|
||||||
if (node.GetUnique())
|
if (node.GetUnique()) {
|
||||||
ret.insert(std::make_pair(std::string(node.GetString()), node.GetIndex()));
|
ret.emplace(node.GetString(), node.GetIndex());
|
||||||
|
}
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::set<std::pair<std::string, s32>> CAnimSourceReaderBase::GetUniqueInt32POIs() const {
|
std::set<std::pair<std::string, s32>> CAnimSourceReaderBase::GetUniqueInt32POIs() const {
|
||||||
const std::vector<CInt32POINode>& int32Nodes = x4_sourceInfo->GetInt32POIStream();
|
const std::vector<CInt32POINode>& int32Nodes = x4_sourceInfo->GetInt32POIStream();
|
||||||
std::set<std::pair<std::string, s32>> ret;
|
std::set<std::pair<std::string, s32>> ret;
|
||||||
for (const CInt32POINode& node : int32Nodes)
|
for (const CInt32POINode& node : int32Nodes) {
|
||||||
if (node.GetUnique())
|
if (node.GetUnique()) {
|
||||||
ret.insert(std::make_pair(std::string(node.GetString()), node.GetIndex()));
|
ret.emplace(node.GetString(), node.GetIndex());
|
||||||
|
}
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::set<std::pair<std::string, s32>> CAnimSourceReaderBase::GetUniqueBoolPOIs() const {
|
std::set<std::pair<std::string, s32>> CAnimSourceReaderBase::GetUniqueBoolPOIs() const {
|
||||||
const std::vector<CBoolPOINode>& boolNodes = x4_sourceInfo->GetBoolPOIStream();
|
const std::vector<CBoolPOINode>& boolNodes = x4_sourceInfo->GetBoolPOIStream();
|
||||||
std::set<std::pair<std::string, s32>> ret;
|
std::set<std::pair<std::string, s32>> ret;
|
||||||
for (const CBoolPOINode& node : boolNodes)
|
for (const CBoolPOINode& node : boolNodes) {
|
||||||
if (node.GetUnique())
|
if (node.GetUnique()) {
|
||||||
ret.insert(std::make_pair(std::string(node.GetString()), node.GetIndex()));
|
ret.emplace(node.GetString(), node.GetIndex());
|
||||||
|
}
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue