From 315becf1b51fb2813ea6ee5723ce5447fa6c91ac Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 31 Mar 2020 07:36:24 -0400 Subject: [PATCH] ATBL: Collapse std::vector construction and resize into one another Same behavior, less code. --- DataSpec/DNACommon/ATBL.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/DataSpec/DNACommon/ATBL.cpp b/DataSpec/DNACommon/ATBL.cpp index 24b4a37f1..10e5f3ead 100644 --- a/DataSpec/DNACommon/ATBL.cpp +++ b/DataSpec/DNACommon/ATBL.cpp @@ -48,9 +48,7 @@ bool ATBL::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat maxI = std::max(maxI, i); } - std::vector vecOut; - vecOut.resize(maxI + 1, 0xffff); - + std::vector vecOut(maxI + 1, 0xffff); for (const auto& pair : dr.getRootNode()->m_mapChildren) { unsigned long i = strtoul(pair.first.c_str(), nullptr, 0); vecOut[i] = hecl::SBig(uint16_t(strtoul(pair.second->m_scalarString.c_str(), nullptr, 0)));