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

Merge branch 'esp32_prefs_vector' into integration

This commit is contained in:
J. Nick Koston
2025-08-14 22:42:34 -05:00

View File

@@ -168,7 +168,7 @@ class ESP32Preferences : public ESPPreferences {
return true;
}
// Use unique_ptr to avoid vector overhead for temporary comparison
std::unique_ptr<uint8_t[]> stored_data(new uint8_t[actual_len]);
auto stored_data = std::make_unique<uint8_t[]>(actual_len);
err = nvs_get_blob(nvs_handle, to_save.key.c_str(), stored_data.get(), &actual_len);
if (err != 0) {
ESP_LOGV(TAG, "nvs_get_blob('%s') failed: %s", to_save.key.c_str(), esp_err_to_name(err));