Skip to content

Commit ae4c780

Browse files
committed
Use unordered_map, no need for an ordered map
1 parent 5f3322a commit ae4c780

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Managers/SettingsMan.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ namespace RTE {
375375
/// Gets the map of mods which are disabled.
376376
/// </summary>
377377
/// <returns>Map of mods which are disabled.</returns>
378-
std::map<std::string, bool> & GetDisabledModsMap() { return m_DisabledMods; }
378+
std::unordered_map<std::string, bool> & GetDisabledModsMap() { return m_DisabledMods; }
379379

380380
/// <summary>
381381
/// Gets whether the specified mod is disabled in the settings.
@@ -388,7 +388,7 @@ namespace RTE {
388388
/// Gets the map of global scripts which are enabled.
389389
/// </summary>
390390
/// <returns>Map of global scripts which are enabled.</returns>
391-
std::map<std::string, bool> & GetEnabledGlobalScriptMap() { return m_EnabledGlobalScripts; }
391+
std::unordered_map<std::string, bool> & GetEnabledGlobalScriptMap() { return m_EnabledGlobalScripts; }
392392

393393
/// <summary>
394394
/// Gets whether the specified global script is enabled in the settings.
@@ -563,8 +563,8 @@ namespace RTE {
563563
bool m_MeasureModuleLoadTime; //!< Whether to measure the duration of data module loading (extraction included). For benchmarking purposes.
564564

565565
std::list<std::string> m_VisibleAssemblyGroupsList; //!< List of assemblies groups always shown in editors.
566-
std::map<std::string, bool> m_DisabledMods; //!< Map of the module names we disabled.
567-
std::map<std::string, bool> m_EnabledGlobalScripts; //!< Map of the global script names we enabled.
566+
std::unordered_map<std::string, bool> m_DisabledMods; //!< Map of the module names we disabled.
567+
std::unordered_map<std::string, bool> m_EnabledGlobalScripts; //!< Map of the global script names we enabled.
568568

569569
private:
570570

Menus/ModManagerGUI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ namespace RTE {
118118
void ModManagerGUI::ToggleMod() {
119119
int index = m_ModsListBox->GetSelectedIndex();
120120
if (index > -1) {
121-
std::map<std::string, bool> &disabledModsList = g_SettingsMan.GetDisabledModsMap();
121+
std::unordered_map<std::string, bool> &disabledModsList = g_SettingsMan.GetDisabledModsMap();
122122
GUIListPanel::Item *selectedItem = m_ModsListBox->GetSelected();
123123
ModRecord &modRecord = m_KnownMods.at(selectedItem->m_ExtraIndex);
124124

@@ -146,7 +146,7 @@ namespace RTE {
146146
void ModManagerGUI::ToggleScript() {
147147
int index = m_ScriptsListBox->GetSelectedIndex();
148148
if (index > -1) {
149-
std::map<std::string, bool> &enabledScriptList = g_SettingsMan.GetEnabledGlobalScriptMap();
149+
std::unordered_map<std::string, bool> &enabledScriptList = g_SettingsMan.GetEnabledGlobalScriptMap();
150150
GUIListPanel::Item *selectedItem = m_ScriptsListBox->GetSelected();
151151
ScriptRecord &scriptRecord = m_KnownScripts.at(selectedItem->m_ExtraIndex);
152152

0 commit comments

Comments
 (0)