[select] Eliminate string allocation in state callbacks (#12505)

Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
This commit is contained in:
J. Nick Koston
2025-12-17 12:19:26 -10:00
committed by GitHub
co-authored by Jonathan Swoboda
parent dc8f7abce2
commit 91c504061b
5 changed files with 12 additions and 10 deletions
@@ -7,7 +7,7 @@ namespace copy {
static const char *const TAG = "copy.select";
void CopySelect::setup() {
source_->add_on_state_callback([this](const std::string &value, size_t index) { this->publish_state(index); });
source_->add_on_state_callback([this](size_t index) { this->publish_state(index); });
traits.set_options(source_->traits.get_options());