mirror of
https://github.com/esphome/esphome.git
synced 2025-09-16 10:12:21 +01:00
Replace std::move() with const references where possible (#2421)
* Replace std::move() with const references where possible * Fix formatting
This commit is contained in:
@@ -12,14 +12,14 @@ namespace text_sensor {
|
||||
class TextSensorStateTrigger : public Trigger<std::string> {
|
||||
public:
|
||||
explicit TextSensorStateTrigger(TextSensor *parent) {
|
||||
parent->add_on_state_callback([this](std::string value) { this->trigger(std::move(value)); });
|
||||
parent->add_on_state_callback([this](const std::string &value) { this->trigger(value); });
|
||||
}
|
||||
};
|
||||
|
||||
class TextSensorStateRawTrigger : public Trigger<std::string> {
|
||||
public:
|
||||
explicit TextSensorStateRawTrigger(TextSensor *parent) {
|
||||
parent->add_on_raw_state_callback([this](std::string value) { this->trigger(std::move(value)); });
|
||||
parent->add_on_raw_state_callback([this](const std::string &value) { this->trigger(value); });
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user