ATBL: Collapse std::vector construction and resize into one another

Same behavior, less code.
This commit is contained in:
Lioncash 2020-03-31 07:36:24 -04:00
parent 3e084d2ae2
commit 315becf1b5
1 changed files with 1 additions and 3 deletions

View File

@ -48,9 +48,7 @@ bool ATBL::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
maxI = std::max(maxI, i); maxI = std::max(maxI, i);
} }
std::vector<uint16_t> vecOut; std::vector<uint16_t> vecOut(maxI + 1, 0xffff);
vecOut.resize(maxI + 1, 0xffff);
for (const auto& pair : dr.getRootNode()->m_mapChildren) { for (const auto& pair : dr.getRootNode()->m_mapChildren) {
unsigned long i = strtoul(pair.first.c_str(), nullptr, 0); 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))); vecOut[i] = hecl::SBig(uint16_t(strtoul(pair.second->m_scalarString.c_str(), nullptr, 0)));