refactor: EventLogger sonar suggestion to define index2 in the if
This commit is contained in:
parent
0890bcac42
commit
bc9bc906a5
1 changed files with 1 additions and 2 deletions
|
|
@ -270,8 +270,7 @@ void EventQueue::removeHandler(EventTypes type, void *target)
|
||||||
HandlerTable::iterator index = m_handlers.find(target);
|
HandlerTable::iterator index = m_handlers.find(target);
|
||||||
if (index != m_handlers.end()) {
|
if (index != m_handlers.end()) {
|
||||||
TypeHandlerTable &typeHandlers = index->second;
|
TypeHandlerTable &typeHandlers = index->second;
|
||||||
TypeHandlerTable::iterator index2 = typeHandlers.find(type);
|
if (auto index2 = typeHandlers.find(type); index2 != typeHandlers.end()) {
|
||||||
if (index2 != typeHandlers.end()) {
|
|
||||||
typeHandlers.erase(index2);
|
typeHandlers.erase(index2);
|
||||||
}
|
}
|
||||||
if (typeHandlers.empty()) {
|
if (typeHandlers.empty()) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue