mirror of
https://github.com/esphome/esphome.git
synced 2025-09-18 03:02:20 +01:00
Avoid non-const globals and enable clang-tidy check (#1892)
This commit is contained in:
@@ -4,10 +4,10 @@
|
||||
namespace esphome {
|
||||
namespace json {
|
||||
|
||||
static const char *TAG = "json";
|
||||
static const char *const TAG = "json";
|
||||
|
||||
static char *global_json_build_buffer = nullptr;
|
||||
static size_t global_json_build_buffer_size = 0;
|
||||
static char *global_json_build_buffer = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||
static size_t global_json_build_buffer_size = 0; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||
|
||||
void reserve_global_json_build_buffer(size_t required_size) {
|
||||
if (global_json_build_buffer_size == 0 || global_json_build_buffer_size < required_size) {
|
||||
@@ -123,7 +123,7 @@ void VectorJsonBuffer::reserve(size_t size) { // NOLINT
|
||||
|
||||
size_t VectorJsonBuffer::size() const { return this->size_; }
|
||||
|
||||
VectorJsonBuffer global_json_buffer;
|
||||
VectorJsonBuffer global_json_buffer; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
||||
|
||||
} // namespace json
|
||||
} // namespace esphome
|
||||
|
Reference in New Issue
Block a user