From 80a48ec77c3e68f18549cdba0346c6e61e8fa953 Mon Sep 17 00:00:00 2001 From: Michael Davidson Date: Sun, 25 Feb 2024 22:03:02 +1100 Subject: [PATCH] Apply clang-tidy suggestions --- esphome/components/graphical_layout/text_run_panel.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/components/graphical_layout/text_run_panel.h b/esphome/components/graphical_layout/text_run_panel.h index 6da76ba97a..9b33ead3ca 100644 --- a/esphome/components/graphical_layout/text_run_panel.h +++ b/esphome/components/graphical_layout/text_run_panel.h @@ -175,7 +175,7 @@ struct RunProperties { class CalculatedTextRun { public: CalculatedTextRun(std::shared_ptr run, RunProperties run_properties) { - this->run = run; + this->run = std::move(run); this->run_properties = run_properties; } @@ -258,7 +258,7 @@ class TextRunPanel : public LayoutItem { this->can_wrap_at_character_ = can_wrap_at_character; }; - void add_text_run(std::shared_ptr text_run) { this->text_runs_.push_back(text_run); }; + void add_text_run(const std::shared_ptr &text_run) { this->text_runs_.push_back(text_run); }; void set_text_align(display::TextAlign text_align) { this->text_align_ = text_align; }; void set_min_width(int min_width) { this->min_width_ = min_width; }; void set_max_width(int max_width) { this->max_width_ = max_width; };