From: Loic Blot Date: Thu, 21 Sep 2017 16:47:42 +0000 (+0200) Subject: keycode.cpp: use std::unordered_map for keypress cache X-Git-Tag: 5.0.0~817 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=080899b0f1f3c48e9038bff806815016d2b45508;p=oweals%2Fminetest.git keycode.cpp: use std::unordered_map for keypress cache --- diff --git a/src/keycode.cpp b/src/keycode.cpp index cedd0803b..6822875b1 100644 --- a/src/keycode.cpp +++ b/src/keycode.cpp @@ -359,13 +359,13 @@ const KeyPress CancelKey("KEY_CANCEL"); */ // A simple cache for quicker lookup -std::map g_key_setting_cache; +std::unordered_map g_key_setting_cache; KeyPress getKeySetting(const char *settingname) { - std::map::iterator n; + std::unordered_map::iterator n; n = g_key_setting_cache.find(settingname); - if(n != g_key_setting_cache.end()) + if (n != g_key_setting_cache.end()) return n->second; KeyPress k(g_settings->get(settingname).c_str());