diff --git a/Core/Config.cpp b/Core/Config.cpp index a60d1dbedf..1d97f59050 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -1893,19 +1893,14 @@ void PlayTimeTracker::Stop(const std::string &gameId) { void PlayTimeTracker::Load(const Section *section) { tracker_.clear(); - std::vector keys; - section->GetKeys(keys); - - for (auto key : keys) { - std::string value; - if (!section->Get(key.c_str(), &value, nullptr)) { - continue; - } + auto map = section->ToMap(); + for (const auto &iter : map) { + const std::string &value = iter.second; // Parse the string. PlayTime gameTime{}; if (2 == sscanf(value.c_str(), "%d,%llu", &gameTime.totalTimePlayed, (long long *)&gameTime.lastTimePlayed)) { - tracker_[key] = gameTime; + tracker_[iter.first.c_str()] = gameTime; } } }