mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-12 03:04:27 +05:00
refactor: added doc.clear() doc.shrinkToFit() in some code areas
This commit is contained in:
@@ -505,6 +505,7 @@ protected:
|
||||
bool publishSettings(const char* topic) {
|
||||
JsonDocument doc;
|
||||
safeSettingsToJson(settings, doc);
|
||||
doc.shrinkToFit();
|
||||
|
||||
return this->writer->publish(topic, doc, true);
|
||||
}
|
||||
@@ -512,6 +513,7 @@ protected:
|
||||
bool publishVariables(const char* topic) {
|
||||
JsonDocument doc;
|
||||
varsToJson(vars, doc);
|
||||
doc.shrinkToFit();
|
||||
|
||||
return this->writer->publish(topic, doc, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user