From 1a9aa23ae95014bae74d02fa3771afd1110bd1b0 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 30 Oct 2025 14:25:35 -0500 Subject: [PATCH 1/2] force inline --- esphome/components/select/select_call.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/select/select_call.h b/esphome/components/select/select_call.h index 89f5156800..0b83cb143a 100644 --- a/esphome/components/select/select_call.h +++ b/esphome/components/select/select_call.h @@ -38,7 +38,7 @@ class SelectCall { SelectCall &with_index(size_t index); protected: - optional calculate_target_index_(const char *name); + __attribute__((always_inline)) inline optional calculate_target_index_(const char *name); Select *const parent_; optional index_; From f447aaed8d82a3f193286922c9192a4e71b39238 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 30 Oct 2025 14:26:37 -0500 Subject: [PATCH 2/2] force inline --- esphome/components/select/select_call.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/esphome/components/select/select_call.cpp b/esphome/components/select/select_call.cpp index 19148d6e03..ae1e6b2f39 100644 --- a/esphome/components/select/select_call.cpp +++ b/esphome/components/select/select_call.cpp @@ -117,10 +117,10 @@ void SelectCall::perform() { return; } + auto idx = target_index.value(); // All operations use indices, call control() by index to avoid string conversion - const auto &options = parent->traits.get_options(); - ESP_LOGD(TAG, "'%s' - Set selected option to: %s", name, options[target_index.value()]); - parent->control(target_index.value()); + ESP_LOGD(TAG, "'%s' - Set selected option to: %s", name, parent->option_at(idx)); + parent->control(idx); } } // namespace select