From 1d54df718528ead24479542444d544b25db42e15 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 18 Jun 2020 12:47:35 -0400 Subject: [PATCH] CAnimSetLoader: Collapse emplace_back() and back() calls into one emplace_back returns a reference to the emplaced element. --- src/Core/Resource/Factory/CAnimSetLoader.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Core/Resource/Factory/CAnimSetLoader.cpp b/src/Core/Resource/Factory/CAnimSetLoader.cpp index 5ca979d7..788b1f30 100644 --- a/src/Core/Resource/Factory/CAnimSetLoader.cpp +++ b/src/Core/Resource/Factory/CAnimSetLoader.cpp @@ -7,8 +7,7 @@ CAnimSetLoader::CAnimSetLoader() = default; void CAnimSetLoader::LoadCorruptionCHAR(IInputStream& rCHAR) { - pSet->mCharacters.emplace_back(SSetCharacter()); - SSetCharacter& rChar = pSet->mCharacters.back(); + SSetCharacter& rChar = pSet->mCharacters.emplace_back(); // Character Header rChar.ID = rCHAR.ReadByte(); @@ -98,8 +97,7 @@ void CAnimSetLoader::LoadReturnsCHAR(IInputStream& rCHAR) uint8 Flag = rCHAR.ReadByte(); rCHAR.Skip(1); - pSet->mCharacters.emplace_back( SSetCharacter() );; - SSetCharacter& rChar = pSet->mCharacters.back(); + SSetCharacter& rChar = pSet->mCharacters.emplace_back(); // Character Header rChar.ID = 0; @@ -655,7 +653,7 @@ std::unique_ptr CAnimSetLoader::LoadSAND(IInputStream& rSAND, C for (uint32 TransitionIdx = 0; TransitionIdx < NumTransitions; TransitionIdx++) { - uint8 UnkByte = rSAND.ReadByte(); + [[maybe_unused]] const uint8 UnkByte = rSAND.ReadByte(); ASSERT(UnkByte == 0); CSourceAnimData::STransition Transition; @@ -670,7 +668,7 @@ std::unique_ptr CAnimSetLoader::LoadSAND(IInputStream& rSAND, C for (uint32 HalfIdx = 0; HalfIdx < NumHalfTransitions; HalfIdx++) { - uint8 UnkByte = rSAND.ReadByte(); + [[maybe_unused]] const uint8 UnkByte = rSAND.ReadByte(); ASSERT(UnkByte == 0); CSourceAnimData::SHalfTransition HalfTrans;