mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 08:55:36 +00:00
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
|