Fix minor perf problem in debug mode, navigating long game lists.

InputMappingToPspButton is very slow and was called once per item.
This commit is contained in:
Henrik Rydgård committed 2023-11-13 12:47:28 +01:00
1 parent 19205145e5
commit 802bae6ee8
1 file changed
+2 -2
+2 -2
View File
@@ -158,10 +158,10 @@ public:
std::vector<int> pspKeys;
bool showInfo = false;
if (KeyMap::InputMappingToPspButton(InputMapping(key.deviceId, key.keyCode), &pspKeys)) {
if (HasFocus() && KeyMap::InputMappingToPspButton(InputMapping(key.deviceId, key.keyCode), &pspKeys)) {
for (auto it = pspKeys.begin(), end = pspKeys.end(); it != end; ++it) {
// If the button mapped to triangle, then show the info.
if (HasFocus() && (key.flags & KEY_UP) && *it == CTRL_TRIANGLE) {
if ((key.flags & KEY_UP) && *it == CTRL_TRIANGLE) {
showInfo = true;
}
}