From 7086cf3392a08de3e992630416f77209f4767647 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 29 Mar 2026 18:33:15 -1000 Subject: [PATCH] Fix comment: if statements with early returns, not if-else --- esphome/components/wifi/wifi_component_esp8266.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/wifi/wifi_component_esp8266.cpp b/esphome/components/wifi/wifi_component_esp8266.cpp index cdb5a06a85..8c2e0bfefe 100644 --- a/esphome/components/wifi/wifi_component_esp8266.cpp +++ b/esphome/components/wifi/wifi_component_esp8266.cpp @@ -626,8 +626,8 @@ void WiFiComponent::wifi_pre_setup_() { WiFiSTAConnectStatus WiFiComponent::wifi_sta_connect_status_() const { // Use cached state from wifi_event_callback() instead of calling // wifi_station_get_connect_status() which queries the SDK every time. - // Use if-else instead of switch to avoid GCC generating a CSWTCH - // lookup table in .rodata (flash) on ESP8266. + // Use if statements with early returns instead of switch to avoid GCC + // generating a CSWTCH lookup table in .rodata (flash) on ESP8266. auto state = this->sta_state_; if (state == ESP8266WiFiSTAState::CONNECTED) return WiFiSTAConnectStatus::CONNECTED;