mirror of
https://github.com/esphome/esphome.git
synced 2025-08-03 17:07:54 +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.
|
// as we can not have a true dynamic sized document.
|
||||||
// The excess memory is freed below with `shrinkToFit()`
|
// The excess memory is freed below with `shrinkToFit()`
|
||||||
while (true) {
|
while (true) {
|
||||||
auto DOC_ALLOCATOR = SpiRamAllocator();
|
auto doc_allocator = SpiRamAllocator();
|
||||||
JsonDocument json_document(&DOC_ALLOCATOR);
|
JsonDocument json_document(&doc_allocator);
|
||||||
if (json_document.overflowed()) {
|
if (json_document.overflowed()) {
|
||||||
ESP_LOGE(TAG, "Could not allocate memory for JSON document!");
|
ESP_LOGE(TAG, "Could not allocate memory for JSON document!");
|
||||||
return "{}";
|
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.
|
// as we can not have a true dynamic sized document.
|
||||||
// The excess memory is freed below with `shrinkToFit()`
|
// The excess memory is freed below with `shrinkToFit()`
|
||||||
while (true) {
|
while (true) {
|
||||||
auto DOC_ALLOCATOR = SpiRamAllocator();
|
auto doc_allocator = SpiRamAllocator();
|
||||||
JsonDocument json_document(&DOC_ALLOCATOR);
|
JsonDocument json_document(&doc_allocator);
|
||||||
if (json_document.overflowed()) {
|
if (json_document.overflowed()) {
|
||||||
ESP_LOGE(TAG, "Could not allocate memory for JSON document!");
|
ESP_LOGE(TAG, "Could not allocate memory for JSON document!");
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user