second commit lion review

This commit is contained in:
german77 2021-11-01 14:17:53 -06:00 committed by Narr the Reg
parent 730f078302
commit 77fa4d4bf6
28 changed files with 73 additions and 42 deletions

View file

@ -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