From c973a9b9ac282afda74be1fdac1c7e1ef7ee6d05 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Fri, 26 Apr 2024 23:24:28 -0600 Subject: [PATCH] Remove redundant bounds checks --- src/SFML/Window/DRM/InputImpl.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/SFML/Window/DRM/InputImpl.cpp b/src/SFML/Window/DRM/InputImpl.cpp index f3bbb7509..ca0610cdd 100644 --- a/src/SFML/Window/DRM/InputImpl.cpp +++ b/src/SFML/Window/DRM/InputImpl.cpp @@ -550,9 +550,6 @@ namespace sf::priv::InputImpl bool isKeyPressed(Keyboard::Key key) { const std::lock_guard lock(inputMutex); - if ((static_cast(key) < 0) || (static_cast(key) >= static_cast(keyMap.size()))) - return false; - update(); return keyMap[key]; } @@ -605,9 +602,6 @@ void setVirtualKeyboardVisible(bool /*visible*/) bool isMouseButtonPressed(Mouse::Button button) { const std::lock_guard lock(inputMutex); - if ((static_cast(button) < 0) || (static_cast(button) >= static_cast(mouseMap.size()))) - return false; - update(); return mouseMap[button]; }