From f6b989bd9aa3e3e8f89b5f29e53274b0be856ccd Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 20 Jul 2025 12:15:16 -1000 Subject: [PATCH] cleanup --- esphome/core/scheduler.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/esphome/core/scheduler.cpp b/esphome/core/scheduler.cpp index 4778ad61a1..05b83a1d0a 100644 --- a/esphome/core/scheduler.cpp +++ b/esphome/core/scheduler.cpp @@ -222,11 +222,8 @@ optional HOT Scheduler::next_schedule_in(uint32_t now) { // It performs cleanup and accesses items_[0] without holding a lock, which is only // safe when called from the main thread. Other threads must not call this method. - // Cleanup removed items first - size_t item_count = this->cleanup_(); - // If no items, return empty optional - if (item_count == 0) + if (this->cleanup_() == 0) return {}; auto &item = this->items_[0];