From e15782844e75ca15cb849647c6ab0a76f48213da Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 20 Mar 2026 18:34:55 -1000 Subject: [PATCH] [core] Inline after_loop_tasks_() into header Trivial one-liner (single assignment) called from the inlined loop() and setup(). Eliminates another unnecessary function call. --- esphome/core/application.cpp | 5 ----- esphome/core/application.h | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/esphome/core/application.cpp b/esphome/core/application.cpp index 056a9bf85b..fc865d8b93 100644 --- a/esphome/core/application.cpp +++ b/esphome/core/application.cpp @@ -476,11 +476,6 @@ void Application::before_loop_tasks_(uint32_t loop_start_time) { this->in_loop_ = true; } -void Application::after_loop_tasks_() { - // Clear the in_loop_ flag to indicate we're done processing components - this->in_loop_ = false; -} - #ifdef USE_LWIP_FAST_SELECT bool Application::register_socket(struct lwip_sock *sock) { // It modifies monitored_sockets_ without locking — must only be called from the main loop. diff --git a/esphome/core/application.h b/esphome/core/application.h index 5cb5f32202..5e1dd12186 100644 --- a/esphome/core/application.h +++ b/esphome/core/application.h @@ -618,7 +618,7 @@ class Application { void enable_pending_loops_(); void activate_looping_component_(uint16_t index); void before_loop_tasks_(uint32_t loop_start_time); - void after_loop_tasks_(); + inline void ESPHOME_ALWAYS_INLINE after_loop_tasks_() { this->in_loop_ = false; } /// Process dump_config output one component per loop iteration. /// Extracted from loop() to keep cold startup/reconnect logging out of the hot path.