refactor: EventLogger sonar suggestion to define index2 in the if

This commit is contained in:
sithlord48
2025-11-14 11:55:13 -05:00
committed by Nick Bolton
parent 0890bcac42
commit bc9bc906a5

View File

@ -270,8 +270,7 @@ void EventQueue::removeHandler(EventTypes type, void *target)
HandlerTable::iterator index = m_handlers.find(target);
if (index != m_handlers.end()) {
TypeHandlerTable &typeHandlers = index->second;
TypeHandlerTable::iterator index2 = typeHandlers.find(type);
if (index2 != typeHandlers.end()) {
if (auto index2 = typeHandlers.find(type); index2 != typeHandlers.end()) {
typeHandlers.erase(index2);
}
if (typeHandlers.empty()) {