From a360e43ee81ab2e2077b3368005950ca7097d014 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 27 Mar 2026 16:18:21 -1000 Subject: [PATCH] Fix MapFilter: use init_array_from (missed in merge) --- esphome/components/text_sensor/filter.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/esphome/components/text_sensor/filter.h b/esphome/components/text_sensor/filter.h index fc9b15d494..6db76dcb64 100644 --- a/esphome/components/text_sensor/filter.h +++ b/esphome/components/text_sensor/filter.h @@ -171,12 +171,7 @@ bool map_filter_apply(const Substitution *mappings, size_t count, std::string &v template class MapFilter : public Filter { public: explicit MapFilter(const std::initializer_list &mappings) { - size_t i = 0; - for (const auto &m : mappings) { - if (i >= N) - break; - this->mappings_[i++] = m; - } + init_array_from(this->mappings_, mappings); } bool new_value(std::string &value) override { return map_filter_apply(this->mappings_.data(), N, value); }