mirror of
https://github.com/esphome/esphome.git
synced 2026-03-01 02:14:19 -07:00
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:
@@ -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 ¶m_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) {
|
||||
|
||||
Reference in New Issue
Block a user