mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 17:05:36 +00:00
Remove unused trigger_ back-pointer from Automation
The trigger_ field was only set in the constructor and never read afterward. Removing it saves 4 bytes per Automation instance.
This commit is contained in:
@@ -471,7 +471,7 @@ template<typename... Ts> class ActionList {
|
||||
template<typename... Ts> class Automation {
|
||||
public:
|
||||
Automation() = default;
|
||||
explicit Automation(Trigger<Ts...> *trigger) : trigger_(trigger) { this->trigger_->set_automation_parent(this); }
|
||||
explicit Automation(Trigger<Ts...> *trigger) { trigger->set_automation_parent(this); }
|
||||
|
||||
void add_action(Action<Ts...> *action) { this->actions_.add_action(action); }
|
||||
void add_actions(const std::initializer_list<Action<Ts...> *> &actions) { this->actions_.add_actions(actions); }
|
||||
@@ -488,7 +488,6 @@ template<typename... Ts> class Automation {
|
||||
int num_running() { return this->actions_.num_running(); }
|
||||
|
||||
protected:
|
||||
Trigger<Ts...> *trigger_{nullptr};
|
||||
ActionList<Ts...> actions_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user