From ea7928b3cda5749ba1dcc8e534b1474a28efb28a Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 15 Jun 2024 20:02:10 +0200 Subject: Android: Replace log type names map with array Storing the log type names in a map results in them getting re-sorted by their keys, which doesn't quite give us the sorting we want. In particular, the Achievements category ended up being sorted at R (for RetroAchivements) instead of at A. Every use of the map is just iterating through it, so there's no real reason why it has to be a map anyway. --- Source/Core/Common/Logging/LogManager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Source/Core/Common/Logging/LogManager.cpp') diff --git a/Source/Core/Common/Logging/LogManager.cpp b/Source/Core/Common/Logging/LogManager.cpp index 749117bc74..283bd436e0 100644 --- a/Source/Core/Common/Logging/LogManager.cpp +++ b/Source/Core/Common/Logging/LogManager.cpp @@ -252,12 +252,13 @@ bool LogManager::IsEnabled(LogType type, LogLevel level) const return m_log[type].m_enable && GetLogLevel() >= level; } -std::map LogManager::GetLogTypes() +std::vector LogManager::GetLogTypes() { - std::map log_types; + std::vector log_types; + log_types.reserve(m_log.size()); for (const auto& container : m_log) - log_types.emplace(container.m_short_name, container.m_full_name); + log_types.emplace_back(container); return log_types; } -- cgit v1.2.3