diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-20 20:30:33 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-20 20:30:33 +0100 |
commit | 5ec30d8915debef409f6db6f8ee9b822fb24d46b (patch) | |
tree | 6ed1f32c90b6464047c9e43134d1511cd3030af4 /src/crepe/api/EventManager.cpp | |
parent | 397da65e03ec681922aeea3881918026d36068a7 (diff) |
make format
Diffstat (limited to 'src/crepe/api/EventManager.cpp')
-rw-r--r-- | src/crepe/api/EventManager.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/crepe/api/EventManager.cpp b/src/crepe/api/EventManager.cpp index 64d7c26..993db86 100644 --- a/src/crepe/api/EventManager.cpp +++ b/src/crepe/api/EventManager.cpp @@ -20,8 +20,7 @@ void EventManager::dispatch_events() { } std::vector<CallbackEntry> & handlers = handlers_it->second; - for (auto handler_it = handlers.begin(); handler_it != handlers.end(); - ++handler_it) { + for (auto handler_it = handlers.begin(); handler_it != handlers.end(); ++handler_it) { // If callback is executed and returns true, remove the event from the queue if ((*handler_it).callback->exec(*event)) { event_it = this->events_queue.erase(event_it); @@ -42,15 +41,14 @@ void EventManager::clear() { } void EventManager::unsubscribe(subscription_t event_id) { - for (auto& [event_type, handlers] : this->subscribers) { - for (auto it = handlers.begin(); it != handlers.end();) { - if (it->id == event_id) { - it = handlers.erase(it); - return; - } else { - ++it; - } - } - } + for (auto & [event_type, handlers] : this->subscribers) { + for (auto it = handlers.begin(); it != handlers.end();) { + if (it->id == event_id) { + it = handlers.erase(it); + return; + } else { + ++it; + } + } + } } - |