summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface
diff options
context:
space:
mode:
authorTilka <tilkax@gmail.com>2024-08-16 18:31:07 +0100
committerGitHub <noreply@github.com>2024-08-16 18:31:07 +0100
commitd10c3aaf293d4a5bea332e426882dcb70b5b8b3e (patch)
tree486c3c70304b20617470b0173cb9440f7cb2d55b /Source/Core/InputCommon/ControllerInterface
parent7c21bcd991e38cceccfce7c47c21b1422261bdfe (diff)
parentde1c47a70192a594c2435daa14b58950a613e2ce (diff)
Merge pull request #13012 from mitaclaw/Use-contains-method-2
Use contains method 2
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm2
-rw-r--r--Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm b/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm
index 58de0c302e..5f0022c79b 100644
--- a/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm
+++ b/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm
@@ -179,7 +179,7 @@ std::string KeycodeToName(const CGKeyCode keycode)
{kVK_RightOption, "Right Alt"},
};
- if (named_keys.find(keycode) != named_keys.end())
+ if (named_keys.contains(keycode))
return named_keys.at(keycode);
else
return "Key " + std::to_string(keycode);
diff --git a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
index e9f4f21980..e0ae924b83 100644
--- a/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
+++ b/Source/Core/InputCommon/ControllerInterface/evdev/evdev.cpp
@@ -102,7 +102,7 @@ protected:
for (auto remove_prefix : {"BTN_", "KEY_"})
{
- if (name.find(remove_prefix) == 0)
+ if (name.starts_with(remove_prefix))
return std::string(name.substr(std::strlen(remove_prefix)));
}