Skip to content

Commit 080899b

Browse files
committedSep 21, 2017
keycode.cpp: use std::unordered_map for keypress cache
1 parent 69f3c42 commit 080899b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/keycode.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,13 @@ const KeyPress CancelKey("KEY_CANCEL");
359359
*/
360360

361361
// A simple cache for quicker lookup
362-
std::map<std::string, KeyPress> g_key_setting_cache;
362+
std::unordered_map<std::string, KeyPress> g_key_setting_cache;
363363

364364
KeyPress getKeySetting(const char *settingname)
365365
{
366-
std::map<std::string, KeyPress>::iterator n;
366+
std::unordered_map<std::string, KeyPress>::iterator n;
367367
n = g_key_setting_cache.find(settingname);
368-
if(n != g_key_setting_cache.end())
368+
if (n != g_key_setting_cache.end())
369369
return n->second;
370370

371371
KeyPress k(g_settings->get(settingname).c_str());

0 commit comments

Comments
 (0)
Please sign in to comment.