Add const statement to several variables

This commit is contained in:
Thomas Basler
2023-12-11 19:54:57 +01:00
parent ab4a872daa
commit 47e905bcfc
27 changed files with 82 additions and 87 deletions

View File

@@ -112,7 +112,7 @@ void WebApiDeviceClass::onDeviceAdminPost(AsyncWebServerRequest* request)
return;
}
String json = request->getParam("data", true)->value();
const String json = request->getParam("data", true)->value();
if (json.length() > MQTT_JSON_DOC_SIZE) {
retMsg["message"] = "Data too large!";
@@ -123,7 +123,7 @@ void WebApiDeviceClass::onDeviceAdminPost(AsyncWebServerRequest* request)
}
DynamicJsonDocument root(MQTT_JSON_DOC_SIZE);
DeserializationError error = deserializeJson(root, json);
const DeserializationError error = deserializeJson(root, json);
if (error) {
retMsg["message"] = "Failed to parse data!";