From add7593b4a5712eb4e1694fe28d88c8aea945b10 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 6 Jun 2025 12:44:02 +0100 Subject: [PATCH] 8266 --- esphome/components/api/api_connection.cpp | 7 +++---- esphome/components/api/api_connection.h | 3 --- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/esphome/components/api/api_connection.cpp b/esphome/components/api/api_connection.cpp index 5eb9d64dad..5128998716 100644 --- a/esphome/components/api/api_connection.cpp +++ b/esphome/components/api/api_connection.cpp @@ -1838,10 +1838,9 @@ void APIConnection::process_batch_() { // Handle remaining items more efficiently if (items_processed < this->deferred_batch_.items.size()) { - // Move unprocessed items to the beginning using std::move - std::move(this->deferred_batch_.items.begin() + items_processed, this->deferred_batch_.items.end(), - this->deferred_batch_.items.begin()); - this->deferred_batch_.items.resize(this->deferred_batch_.items.size() - items_processed); + // Remove processed items from the beginning + this->deferred_batch_.items.erase(this->deferred_batch_.items.begin(), + this->deferred_batch_.items.begin() + items_processed); // Reschedule for remaining items this->schedule_batch_(); diff --git a/esphome/components/api/api_connection.h b/esphome/components/api/api_connection.h index a6da2fbeeb..447983a888 100644 --- a/esphome/components/api/api_connection.h +++ b/esphome/components/api/api_connection.h @@ -487,9 +487,6 @@ class APIConnection : public APIServerConnection { uint32_t timestamp; // When this update was queued uint16_t message_type; // Message type for overhead calculation - // Default constructor - BatchItem() : entity(nullptr), timestamp(0), message_type(0) {} - // Constructor for creating BatchItem BatchItem(EntityBase *entity, std::function creator,