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;
/* Assemble extract report */
for (const std::pair<std::string, DNAMP2::PAKBridge*>& item : m_orderedPaks) {
if (!item.second->m_doExtract)
for (const auto& item : m_orderedPaks) {
if (!item.second->m_doExtract) {
continue;
}
rep.childOpts.emplace_back();
ExtractReport& childRep = rep.childOpts.back();
hecl::SystemStringConv nameView(item.first);