From 39330bc6f2ac91ca4d291ec6b47f33ebe27fb388 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Mon, 21 Aug 2023 13:35:04 -0700 Subject: [PATCH] sort DOL files in Programs menu --- src/FunctionCompiler.cc | 2 +- src/FunctionCompiler.hh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FunctionCompiler.cc b/src/FunctionCompiler.cc index c7707ce1..1ed82c1e 100644 --- a/src/FunctionCompiler.cc +++ b/src/FunctionCompiler.cc @@ -273,7 +273,7 @@ DOLFileIndex::DOLFileIndex(const string& directory, bool compress) menu->items.emplace_back(ProgramsMenuItemID::GO_BACK, u"Go back", u"Return to the\nmain menu", 0); uint32_t next_menu_item_id = 0; - for (const auto& filename : list_directory(directory)) { + for (const auto& filename : list_directory_sorted(directory)) { if (!ends_with(filename, ".dol")) { continue; } diff --git a/src/FunctionCompiler.hh b/src/FunctionCompiler.hh index 8363b315..22b34af1 100644 --- a/src/FunctionCompiler.hh +++ b/src/FunctionCompiler.hh @@ -78,7 +78,7 @@ struct DOLFileIndex { bool files_compressed; std::vector> item_id_to_file; - std::map> name_to_file; + std::unordered_map> name_to_file; std::shared_ptr menu; DOLFileIndex() = default;