diff options
Diffstat (limited to 'src/input_common/input_engine.cpp')
-rw-r--r-- | src/input_common/input_engine.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/input_common/input_engine.cpp b/src/input_common/input_engine.cpp index 965a2bdf1..139d8d2e6 100644 --- a/src/input_common/input_engine.cpp +++ b/src/input_common/input_engine.cpp @@ -353,11 +353,12 @@ void InputEngine::SetMappingCallback(MappingCallback callback) { void InputEngine::DeleteCallback(int key) { std::lock_guard lock{mutex_callback}; - 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 InputCommon |