1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-24 14:12:24 +01:00

address copilot review comments

This commit is contained in:
J. Nick Koston
2025-07-30 09:42:28 -10:00
parent 1568fc36cc
commit 8d9daca386

View File

@@ -1685,7 +1685,8 @@ void APIConnection::process_batch_() {
// Pre-calculate exact buffer size needed based on message types // Pre-calculate exact buffer size needed based on message types
uint32_t total_estimated_size = num_items * (header_padding + footer_size); uint32_t total_estimated_size = num_items * (header_padding + footer_size);
for (const auto &item : this->deferred_batch_.items) { for (size_t i = 0; i < this->deferred_batch_.size(); i++) {
const auto &item = this->deferred_batch_[i];
total_estimated_size += item.estimated_size; total_estimated_size += item.estimated_size;
} }