mirror of
https://github.com/esphome/esphome.git
synced 2026-09-11 23:37:34 +00:00
Add comment explaining why add_action uses if/else instead of pointer-to-pointer
This commit is contained in:
@@ -422,7 +422,8 @@ template<typename... Ts> class ActionList {
|
||||
if (this->actions_begin_ == nullptr) {
|
||||
this->actions_begin_ = action;
|
||||
} else {
|
||||
// Walk to end of chain - action lists are short and only built during setup()
|
||||
// Walk to end of chain - action lists are short and only built during setup().
|
||||
// Note: intentionally not using pointer-to-pointer idiom here as it generates larger code.
|
||||
auto *it = this->actions_begin_;
|
||||
while (it->next_ != nullptr)
|
||||
it = it->next_;
|
||||
|
||||
Reference in New Issue
Block a user