From 595b153bbf05014e26cf119a821182088b8755f8 Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Thu, 26 Sep 2024 18:08:48 +0200 Subject: [PATCH] Simplify network callback handling --- src/NetworkSettings.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/NetworkSettings.cpp b/src/NetworkSettings.cpp index 31313feb8..ca8817547 100644 --- a/src/NetworkSettings.cpp +++ b/src/NetworkSettings.cpp @@ -111,8 +111,7 @@ bool NetworkSettingsClass::onEvent(NetworkEventCb cbEvent, const network_event e void NetworkSettingsClass::raiseEvent(const network_event event) { - for (uint32_t i = 0; i < _cbEventList.size(); i++) { - const NetworkEventCbList_t entry = _cbEventList[i]; + for (auto& entry : _cbEventList) { if (entry.cb) { if (entry.event == event || entry.event == network_event::NETWORK_EVENT_MAX) { entry.cb(event);