diff options
Diffstat (limited to 'src/core/hid/emulated_controller.cpp')
| -rw-r--r-- | src/core/hid/emulated_controller.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 9a1864279..7bab00bb1 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) { | |||
| 993 | 993 | ||
| 994 | void EmulatedController::DeleteCallback(int key) { | 994 | void EmulatedController::DeleteCallback(int key) { |
| 995 | std::lock_guard lock{mutex}; | 995 | std::lock_guard lock{mutex}; |
| 996 | if (!callback_list.contains(key)) { | 996 | const auto& iterator = callback_list.find(key); |
| 997 | if (iterator == callback_list.end()) { | ||
| 997 | LOG_ERROR(Input, "Tried to delete non-existent callback {}", key); | 998 | LOG_ERROR(Input, "Tried to delete non-existent callback {}", key); |
| 998 | return; | 999 | return; |
| 999 | } | 1000 | } |
| 1000 | callback_list.erase(key); | 1001 | callback_list.erase(iterator); |
| 1001 | } | 1002 | } |
| 1002 | } // namespace Core::HID | 1003 | } // namespace Core::HID |