SpecMP2: Prevent unnecessary copies in buildPaks()

Uses auto to properly deduce the intended return type in iteration (pair
with a const string), which prevents a copy from needing to be
generated.
This commit is contained in:
Lioncash 2020-03-31 12:43:40 -04:00
parent 97fd815afa
commit e6f217bf25
1 changed files with 3 additions and 2 deletions

View File

@ -101,9 +101,10 @@ struct SpecMP2 : SpecBase {
m_orderedPaks[std::string(dpak.getName())] = &dpak; m_orderedPaks[std::string(dpak.getName())] = &dpak;
/* Assemble extract report */ /* Assemble extract report */
for (const std::pair<std::string, DNAMP2::PAKBridge*>& item : m_orderedPaks) { for (const auto& item : m_orderedPaks) {
if (!item.second->m_doExtract) if (!item.second->m_doExtract) {
continue; continue;
}
rep.childOpts.emplace_back(); rep.childOpts.emplace_back();
ExtractReport& childRep = rep.childOpts.back(); ExtractReport& childRep = rep.childOpts.back();
hecl::SystemStringConv nameView(item.first); hecl::SystemStringConv nameView(item.first);