From 1acd7d4672267a14297eada2aa55192eb3817f28 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 13 Oct 2025 21:56:11 -1000 Subject: [PATCH] Update esphome/core/helpers.h Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- esphome/core/helpers.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/esphome/core/helpers.h b/esphome/core/helpers.h index 75ca600292..326718e974 100644 --- a/esphome/core/helpers.h +++ b/esphome/core/helpers.h @@ -201,9 +201,12 @@ template class FixedVector { /// This enables brace initialization: FixedVector v = {1, 2, 3}; FixedVector(std::initializer_list init_list) { init(init_list.size()); + size_t idx = 0; for (const auto &item : init_list) { - push_back(item); + new (data_ + idx) T(item); + ++idx; } + size_ = init_list.size(); } ~FixedVector() { cleanup_(); }