1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00: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:
Oxan van Leeuwen
2021-09-30 16:25:08 +02:00
committed by GitHub
parent 0e4f1ac40d
commit 5b0fbbaada
8 changed files with 10 additions and 11 deletions

View File

@@ -13,7 +13,7 @@ class PipsolarOutput : public output::FloatOutput {
public:
PipsolarOutput() {}
void set_parent(Pipsolar *parent) { this->parent_ = parent; }
void set_set_command(std::string command) { this->set_command_ = std::move(command); };
void set_set_command(const std::string &command) { this->set_command_ = command; };
void set_possible_values(std::vector<float> possible_values) { this->possible_values_ = std::move(possible_values); }
void set_value(float value) { this->write_state(value); };

View File

@@ -10,8 +10,8 @@ class Pipsolar;
class PipsolarSwitch : public switch_::Switch, public Component {
public:
void set_parent(Pipsolar *parent) { this->parent_ = parent; };
void set_on_command(std::string command) { this->on_command_ = std::move(command); };
void set_off_command(std::string command) { this->off_command_ = std::move(command); };
void set_on_command(const std::string &command) { this->on_command_ = command; };
void set_off_command(const std::string &command) { this->off_command_ = command; };
void dump_config() override;
protected: