From ac28575e9d9d31102c8e97d9446ce66cc5f3077d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 31 Mar 2020 12:32:01 -0400 Subject: [PATCH] SpecMP3: Make use of emplace_back()'s return value Same behavior, less code. --- DataSpec/SpecMP3.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/DataSpec/SpecMP3.cpp b/DataSpec/SpecMP3.cpp index 5dce2b357..632d3c68d 100644 --- a/DataSpec/SpecMP3.cpp +++ b/DataSpec/SpecMP3.cpp @@ -135,8 +135,8 @@ struct SpecMP3 : SpecBase { for (const auto& item : fe ? m_feOrderedPaks : m_orderedPaks) { if (!item.second->m_doExtract) continue; - rep.childOpts.emplace_back(); - ExtractReport& childRep = rep.childOpts.back(); + + ExtractReport& childRep = rep.childOpts.emplace_back(); hecl::SystemStringConv nameView(item.first); childRep.name = hecl::SystemString(nameView.sys_str()); if (item.first == "Worlds.pak") @@ -168,8 +168,7 @@ struct SpecMP3 : SpecBase { return false; /* Root Report */ - reps.emplace_back(); - ExtractReport& rep = reps.back(); + ExtractReport& rep = reps.emplace_back(); rep.name = _SYS_STR("MP3"); rep.desc = _SYS_STR("Metroid Prime 3 ") + regstr; std::string buildStr(buildInfo); @@ -250,8 +249,7 @@ struct SpecMP3 : SpecBase { } /* Root Report */ - reps.emplace_back(); - ExtractReport& rep = reps.back(); + ExtractReport& rep = reps.emplace_back(); rep.name = _SYS_STR("MP3"); rep.desc = _SYS_STR("Metroid Prime 3 ") + regstr; @@ -281,8 +279,7 @@ struct SpecMP3 : SpecBase { const char* buildInfo = (char*)memmem(dolBuf.get(), dolIt->size(), "MetroidBuildInfo", 16) + 19; /* Root Report */ - reps.emplace_back(); - ExtractReport& rep = reps.back(); + ExtractReport& rep = reps.emplace_back(); rep.name = _SYS_STR("fe"); rep.desc = _SYS_STR("Metroid Prime Trilogy Frontend ") + regstr; if (buildInfo) {