mirror of
https://github.com/esphome/esphome.git
synced 2025-09-21 04:32:23 +01:00
zero copy vectors
This commit is contained in:
@@ -5,7 +5,7 @@ namespace select {
|
||||
|
||||
void SelectTraits::set_options(std::vector<std::string> options) { this->options_ = std::move(options); }
|
||||
|
||||
std::vector<std::string> SelectTraits::get_options() const { return this->options_; }
|
||||
const std::vector<std::string> &SelectTraits::get_options() const { return this->options_; }
|
||||
|
||||
} // namespace select
|
||||
} // namespace esphome
|
||||
|
@@ -9,7 +9,7 @@ namespace select {
|
||||
class SelectTraits {
|
||||
public:
|
||||
void set_options(std::vector<std::string> options);
|
||||
std::vector<std::string> get_options() const;
|
||||
const std::vector<std::string> &get_options() const;
|
||||
|
||||
protected:
|
||||
std::vector<std::string> options_;
|
||||
|
Reference in New Issue
Block a user