mirror of
https://github.com/esphome/esphome.git
synced 2026-09-19 19:18:47 +00:00
- Move APIBuffer (renamed from ProtoByteBuffer) to api_buffer.h/cpp - Use APIBuffer for rx_buf_ (frame helper receive buffer) and prologue_ (noise handshake buffer) to skip zero-fill on resize - Remove dead write_raw_ template overload and unused <vector> include
14 lines
295 B
C++
14 lines
295 B
C++
#include "api_buffer.h"
|
|
|
|
namespace esphome::api {
|
|
|
|
void APIBuffer::grow_(size_t n) {
|
|
auto new_data = make_buffer(n);
|
|
if (this->size_)
|
|
std::memcpy(new_data.get(), this->data_.get(), this->size_);
|
|
this->data_ = std::move(new_data);
|
|
this->capacity_ = n;
|
|
}
|
|
|
|
} // namespace esphome::api
|