SpecMP1: Prevent unnecessary copies in buildPaks

Previously the type mismatched by a single const qualifier, which meant
a copy would have to occur.

Instead, we can use auto to avoid this issue from occurring and allowing
the proper type to be automatically deduced.
This commit is contained in:
Lioncash 2020-03-31 12:36:15 -04:00
parent ac28575e9d
commit 305262eb29
1 changed files with 3 additions and 2 deletions

View File

@ -201,9 +201,10 @@ struct SpecMP1 : SpecBase {
/* Assemble extract report */
rep.childOpts.reserve(m_orderedPaks.size());
for (const std::pair<std::string, DNAMP1::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);