mirror of
https://github.com/SFML/SFML.git
synced 2025-02-23 14:56:02 +08:00
Remove redundant bounds checks
This commit is contained in:
parent
d663dd1cc9
commit
c973a9b9ac
@ -550,9 +550,6 @@ namespace sf::priv::InputImpl
|
|||||||
bool isKeyPressed(Keyboard::Key key)
|
bool isKeyPressed(Keyboard::Key key)
|
||||||
{
|
{
|
||||||
const std::lock_guard lock(inputMutex);
|
const std::lock_guard lock(inputMutex);
|
||||||
if ((static_cast<int>(key) < 0) || (static_cast<int>(key) >= static_cast<int>(keyMap.size())))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
update();
|
update();
|
||||||
return keyMap[key];
|
return keyMap[key];
|
||||||
}
|
}
|
||||||
@ -605,9 +602,6 @@ void setVirtualKeyboardVisible(bool /*visible*/)
|
|||||||
bool isMouseButtonPressed(Mouse::Button button)
|
bool isMouseButtonPressed(Mouse::Button button)
|
||||||
{
|
{
|
||||||
const std::lock_guard lock(inputMutex);
|
const std::lock_guard lock(inputMutex);
|
||||||
if ((static_cast<int>(button) < 0) || (static_cast<int>(button) >= static_cast<int>(mouseMap.size())))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
update();
|
update();
|
||||||
return mouseMap[button];
|
return mouseMap[button];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user