mirror of
https://github.com/esphome/esphome.git
synced 2025-08-03 00:47:47 +00:00
clang fix
This commit is contained in:
parent
44f97e2de4
commit
9ef982fa4d
@ -31,8 +31,8 @@ std::string build_json(const json_build_t &f) {
|
||||
// as we can not have a true dynamic sized document.
|
||||
// The excess memory is freed below with `shrinkToFit()`
|
||||
while (true) {
|
||||
auto DOC_ALLOCATOR = SpiRamAllocator();
|
||||
JsonDocument json_document(&DOC_ALLOCATOR);
|
||||
auto doc_allocator = SpiRamAllocator();
|
||||
JsonDocument json_document(&doc_allocator);
|
||||
if (json_document.overflowed()) {
|
||||
ESP_LOGE(TAG, "Could not allocate memory for JSON document!");
|
||||
return "{}";
|
||||
@ -59,8 +59,8 @@ bool parse_json(const std::string &data, const json_parse_t &f) {
|
||||
// as we can not have a true dynamic sized document.
|
||||
// The excess memory is freed below with `shrinkToFit()`
|
||||
while (true) {
|
||||
auto DOC_ALLOCATOR = SpiRamAllocator();
|
||||
JsonDocument json_document(&DOC_ALLOCATOR);
|
||||
auto doc_allocator = SpiRamAllocator();
|
||||
JsonDocument json_document(&doc_allocator);
|
||||
if (json_document.overflowed()) {
|
||||
ESP_LOGE(TAG, "Could not allocate memory for JSON document!");
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user