From 080899b0f1f3c48e9038bff806815016d2b45508 Mon Sep 17 00:00:00 2001 From: Loic Blot Date: Thu, 21 Sep 2017 18:47:42 +0200 Subject: [PATCH] keycode.cpp: use std::unordered_map for keypress cache --- src/keycode.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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()); -- 2.25.1