mirror of
https://github.com/esphome/esphome.git
synced 2026-02-26 14:03:14 -07:00
Merge branch 'prefs_no_churn_reuse' into integration
This commit is contained in:
@@ -23,7 +23,7 @@ struct NVSData {
|
||||
size_t len;
|
||||
|
||||
void set_data(const uint8_t *src, size_t size) {
|
||||
if (this->len != size) {
|
||||
if (!this->data || this->len != size) {
|
||||
this->data = std::make_unique<uint8_t[]>(size);
|
||||
this->len = size;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ struct NVSData {
|
||||
size_t len;
|
||||
|
||||
void set_data(const uint8_t *src, size_t size) {
|
||||
if (this->len != size) {
|
||||
if (!this->data || this->len != size) {
|
||||
this->data = std::make_unique<uint8_t[]>(size);
|
||||
this->len = size;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user