From 82240d262bb2346a9f9046fde60bfd42d1bfd42d Mon Sep 17 00:00:00 2001 From: Dav999 Date: Wed, 25 Oct 2023 02:57:50 +0200 Subject: [PATCH] Game::loadcustomlevelstats: move some declarations to later in function The declarations of `std::vector customlevelnames` and `std::vector customlevelscores` are made quite early in the function, commented with "Old system", but the place where the old system is processed is after a big chunk of code that processes the new system (and indeed never uses these vectors). So for readability, they're now closer to where they're used. --- desktop_version/src/Game.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index e97fabf4..5bd3a044 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -504,10 +504,6 @@ void Game::loadcustomlevelstats(void) customlevelstats.clear(); - // Old system - std::vector customlevelnames; - std::vector customlevelscores; - tinyxml2::XMLElement* pElem; tinyxml2::XMLElement* firstElement; @@ -553,6 +549,9 @@ void Game::loadcustomlevelstats(void) // Since we're still here, we must be on the old system + std::vector customlevelnames; + std::vector customlevelscores; + for (pElem = firstElement; pElem; pElem=pElem->NextSiblingElement()) { const char* pKey = pElem->Value();