DNAMP2: Prevent unnecessary copies

Auto-deduces the exact type instead of using a similar, but slightly off
pair type (which causes a copy).
This commit is contained in:
Lioncash 2020-03-31 13:19:32 -04:00
parent d8ed1a5e79
commit 3d0270cf82
1 changed files with 2 additions and 2 deletions

View File

@ -151,7 +151,7 @@ void PAKBridge::build() {
} }
void PAKBridge::addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const { void PAKBridge::addCMDLRigPairs(PAKRouter<PAKBridge>& pakRouter, CharacterAssociations<UniqueID32>& charAssoc) const {
for (const std::pair<UniqueID32, DNAMP2::PAK::Entry>& entry : m_pak.m_entries) { for (const auto& entry : m_pak.m_entries) {
if (entry.second.type == FOURCC('ANCS')) { if (entry.second.type == FOURCC('ANCS')) {
PAKEntryReadStream rs = entry.second.beginReadStream(m_node); PAKEntryReadStream rs = entry.second.beginReadStream(m_node);
ANCS ancs; ANCS ancs;
@ -175,7 +175,7 @@ static const atVec4f BottomRow = {{0.f, 0.f, 0.f, 1.f}};
void PAKBridge::addMAPATransforms(PAKRouter<PAKBridge>& pakRouter, void PAKBridge::addMAPATransforms(PAKRouter<PAKBridge>& pakRouter,
std::unordered_map<UniqueID32, zeus::CMatrix4f>& addTo, std::unordered_map<UniqueID32, zeus::CMatrix4f>& addTo,
std::unordered_map<UniqueID32, hecl::ProjectPath>& pathOverrides) const { std::unordered_map<UniqueID32, hecl::ProjectPath>& pathOverrides) const {
for (const std::pair<UniqueID32, DNAMP2::PAK::Entry>& entry : m_pak.m_entries) { for (const auto& entry : m_pak.m_entries) {
if (entry.second.type == FOURCC('MLVL')) { if (entry.second.type == FOURCC('MLVL')) {
MLVL mlvl; MLVL mlvl;
{ {