1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-03 10:32:21 +01:00

tweak, compiler optimizes it away anyways though

This commit is contained in:
J. Nick Koston
2025-10-01 20:36:40 +02:00
parent a4c794c9fa
commit 4b10bf09be

View File

@@ -111,9 +111,11 @@ void APIFrameHelper::buffer_data_from_iov_(const struct iovec *iov, int iovcnt,
uint16_t buffer_size = total_write_len - offset;
auto &buffer = this->tx_buf_[this->tx_buf_tail_];
buffer = std::make_unique<SendBuffer>();
buffer->size = buffer_size;
buffer->data = std::make_unique<uint8_t[]>(buffer_size);
buffer = std::make_unique<SendBuffer>(SendBuffer{
.data = std::make_unique<uint8_t[]>(buffer_size),
.size = buffer_size,
.offset = 0,
});
uint16_t to_skip = offset;
uint16_t write_pos = 0;