Fix clang-tidy: use const auto& for arg() return value

On Arduino, arg() returns const String&, so auto copies unnecessarily.
const auto& binds to the reference on Arduino and extends the temporary
lifetime on IDF.
This commit is contained in:
J. Nick Koston
2026-02-11 17:37:09 -06:00
parent 4f3c95ced2
commit db831ebee0

View File

@@ -574,7 +574,7 @@ class WebServer : public Controller,
template<typename T, typename Ret>
void parse_bool_param_(AsyncWebServerRequest *request, ParamNameType param_name, T &call, Ret (T::*setter)(bool)) {
if (request->hasArg(param_name)) {
auto param_value = request->arg(param_name);
const auto &param_value = request->arg(param_name);
// First check on/off (default), then true/false (custom)
auto val = parse_on_off(param_value.c_str());
if (val == PARSE_NONE) {