From 3c85ff474409186ad78ff9c8edb945f4db935cfc Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 7 Feb 2026 19:56:20 +0100 Subject: [PATCH] try to avoid bloat --- esphome/core/scheduler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/core/scheduler.cpp b/esphome/core/scheduler.cpp index 047ad02a8c..6797640f54 100644 --- a/esphome/core/scheduler.cpp +++ b/esphome/core/scheduler.cpp @@ -402,7 +402,7 @@ void Scheduler::full_cleanup_removed_items_() { this->recycle_item_main_loop_(std::move(this->items_[read])); } } - this->items_.resize(write); + this->items_.erase(this->items_.begin() + write, this->items_.end()); // Rebuild the heap structure since items are no longer in heap order std::make_heap(this->items_.begin(), this->items_.end(), SchedulerItem::cmp); this->to_remove_ = 0;