1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-16 18:05:22 +02:00

Some globals (un-)init fixes

This commit is contained in:
sfan5
2024-04-11 13:54:09 +02:00
parent 2af5191070
commit d8190e1c5f
16 changed files with 58 additions and 62 deletions

View File

@@ -355,12 +355,11 @@ const KeyPress CancelKey("KEY_CANCEL");
*/
// A simple cache for quicker lookup
std::unordered_map<std::string, KeyPress> g_key_setting_cache;
static std::unordered_map<std::string, KeyPress> g_key_setting_cache;
KeyPress getKeySetting(const char *settingname)
{
std::unordered_map<std::string, KeyPress>::iterator n;
n = g_key_setting_cache.find(settingname);
auto n = g_key_setting_cache.find(settingname);
if (n != g_key_setting_cache.end())
return n->second;