From bfca9cb6c245102dfb24bd35ec6d16e332ffa318 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 6 Nov 2025 11:37:08 -0600 Subject: [PATCH] preen --- esphome/components/wifi/wifi_component.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/esphome/components/wifi/wifi_component.cpp b/esphome/components/wifi/wifi_component.cpp index d2a44ce8da..db99c78329 100644 --- a/esphome/components/wifi/wifi_component.cpp +++ b/esphome/components/wifi/wifi_component.cpp @@ -386,10 +386,8 @@ WiFiAP WiFiComponent::build_selected_ap_() const { } WiFiAP WiFiComponent::get_sta() { - if (const WiFiAP *config = this->get_selected_sta_()) { - return *config; - } - return WiFiAP{}; + const WiFiAP *config = this->get_selected_sta_(); + return config ? *config : WiFiAP{}; } void WiFiComponent::save_wifi_sta(const std::string &ssid, const std::string &password) { SavedWifiSettings save{}; // zero-initialized - all bytes set to \0, guaranteeing null termination