From 802bae6ee8e2452774ead1a70e36857e9308bb52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 13 Nov 2023 12:47:28 +0100 Subject: [PATCH] Fix minor perf problem in debug mode, navigating long game lists. InputMappingToPspButton is very slow and was called once per item. --- UI/MainScreen.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 7a6f8d4c71..0ad55db3df 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -158,10 +158,10 @@ public: std::vector 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; } }