From 9ef982fa4d1fc831287855a8ae096fcb913ab4a7 Mon Sep 17 00:00:00 2001 From: Kevin Ahrendt Date: Wed, 21 May 2025 21:51:45 +0000 Subject: [PATCH] clang fix --- esphome/components/json/json_util.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/esphome/components/json/json_util.cpp b/esphome/components/json/json_util.cpp index 4181f60f66..51317df343 100644 --- a/esphome/components/json/json_util.cpp +++ b/esphome/components/json/json_util.cpp @@ -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;