Change container type for several uses of std::map/std::set

This commit is contained in:
Jonathan G Rennison
2024-05-30 18:16:13 +01:00
parent 853ed272be
commit 56356bb761
11 changed files with 36 additions and 26 deletions

View File

@@ -12,7 +12,7 @@
#include "script_object.hpp"
#include "script_companymode.hpp"
#include <map>
#include "../../3rdparty/robin_hood/robin_hood.h"
#include <optional>
/**
@@ -221,8 +221,8 @@ public:
static void RegisterErrorMapString(ScriptErrorType ai_error_msg, const char *message);
private:
typedef std::map<StringID, ScriptErrorType> ScriptErrorMap; ///< The type for mapping between error (internal OpenTTD) StringID to the script error type.
typedef std::map<ScriptErrorType, const char *> ScriptErrorMapString; ///< The type for mapping between error type and textual representation.
typedef robin_hood::unordered_flat_map<StringID, ScriptErrorType> ScriptErrorMap; ///< The type for mapping between error (internal OpenTTD) StringID to the script error type.
typedef robin_hood::unordered_flat_map<ScriptErrorType, const char *> ScriptErrorMapString; ///< The type for mapping between error type and textual representation.
static ScriptErrorMap error_map; ///< The mapping between error (internal OpenTTD) StringID to the script error type.
static ScriptErrorMapString error_map_string; ///< The mapping between error type and textual representation.