aboutsummaryrefslogtreecommitdiff
path: root/src/core/hid/emulated_controller.cpp
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2021-11-01 14:17:53 -0600
committerNarr the Reg <juangerman-13@hotmail.com>2021-11-24 20:30:26 -0600
commit4736326a0555257e551e4a7b8626e3c22d684306 (patch)
tree3c6c07d535bd912ed085be9b826103a6eabe718f /src/core/hid/emulated_controller.cpp
parenta8852024b611f38bedd166a7239f4b4d73fb06ce (diff)
second commit lion review
Diffstat (limited to 'src/core/hid/emulated_controller.cpp')
-rw-r--r--src/core/hid/emulated_controller.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index 9a18642791..7bab00bb1b 100644
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -993,10 +993,11 @@ int EmulatedController::SetCallback(ControllerUpdateCallback update_callback) {
void EmulatedController::DeleteCallback(int key) {
std::lock_guard lock{mutex};
- if (!callback_list.contains(key)) {
+ const auto& iterator = callback_list.find(key);
+ if (iterator == callback_list.end()) {
LOG_ERROR(Input, "Tried to delete non-existent callback {}", key);
return;
}
- callback_list.erase(key);
+ callback_list.erase(iterator);
}
} // namespace Core::HID