chore: use more ranged for loops

This commit is contained in:
sithlord48
2025-05-21 21:55:49 -04:00
committed by Nick Bolton
parent 456afaa13e
commit a33574e1bd
13 changed files with 99 additions and 102 deletions

View File

@ -298,16 +298,16 @@ void EventQueue::removeHandlers(void *target)
if (index != m_handlers.end()) {
// copy to handlers array and clear table for target
TypeHandlerTable &typeHandlers = index->second;
for (auto index2 = typeHandlers.begin(); index2 != typeHandlers.end(); ++index2) {
handlers.push_back(index2->second);
for (const auto &[key, value] : typeHandlers) {
handlers.push_back(value);
}
typeHandlers.clear();
}
}
// delete handlers
for (auto index = handlers.begin(); index != handlers.end(); ++index) {
delete *index;
for (auto index : handlers) {
delete index;
}
}