Add comment explaining why add_action uses if/else instead of pointer-to-pointer

This commit is contained in:
J. Nick Koston
2026-03-28 10:46:36 -10:00
parent e3e5f40a96
commit b209fe7ebe
+2 -1
View File
@@ -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_;