From 71c95d76fc54a38ac766f4e2278a9a1f7d52dd62 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 20 Mar 2026 19:23:39 -1000 Subject: [PATCH] [core] Move runtime_stats include to top of application.h Eliminates the namespace close/reopen that was needed when the include was between the two inline definitions. --- esphome/core/application.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/esphome/core/application.h b/esphome/core/application.h index f916b6604b..1bf8fcc0b5 100644 --- a/esphome/core/application.h +++ b/esphome/core/application.h @@ -41,6 +41,9 @@ #endif #endif #endif // USE_SOCKET_SELECT_SUPPORT +#ifdef USE_RUNTIME_STATS +#include "esphome/components/runtime_stats/runtime_stats.h" +#endif #if (defined(USE_ESP8266) || defined(USE_RP2040)) && defined(USE_SOCKET_IMPL_LWIP_TCP) namespace esphome::socket { void socket_wake(); // NOLINT(readability-redundant-declaration) @@ -827,14 +830,6 @@ inline void Application::drain_wake_notifications_() { } #endif // defined(USE_SOCKET_SELECT_SUPPORT) && defined(USE_WAKE_LOOP_THREADSAFE) && !defined(USE_LWIP_FAST_SELECT) -} // namespace esphome - -#ifdef USE_RUNTIME_STATS -#include "esphome/components/runtime_stats/runtime_stats.h" -#endif - -namespace esphome { - inline void ESPHOME_ALWAYS_INLINE Application::loop() { uint8_t new_app_state = 0;