[core] Inline calculate_looping_components_ into header (#14944)

This commit is contained in:
J. Nick Koston
2026-03-19 14:11:17 -10:00
committed by GitHub
parent 902258b56e
commit a9cb7143dc
2 changed files with 13 additions and 17 deletions
-16
View File
@@ -394,22 +394,6 @@ void Application::teardown_components(uint32_t timeout_ms) {
}
}
void Application::calculate_looping_components_() {
// FixedVector capacity was pre-initialized by codegen with the exact count
// of components that override loop(), computed at C++ compile time.
// Add all components with loop override that aren't already LOOP_DONE
// Some components (like logger) may call disable_loop() during initialization
// before setup runs, so we need to respect their LOOP_DONE state
this->add_looping_components_by_state_(false);
this->looping_components_active_end_ = this->looping_components_.size();
// Then add any components that are already LOOP_DONE to the inactive section
// This handles components that called disable_loop() during initialization
this->add_looping_components_by_state_(true);
}
void Application::add_looping_components_by_state_(bool match_loop_done) {
for (auto *obj : this->components_) {
if (obj->has_overridden_loop() &&
+13 -1
View File
@@ -595,7 +595,19 @@ class Application {
void register_component_impl_(Component *comp, bool has_loop);
void calculate_looping_components_();
void calculate_looping_components_() {
// FixedVector capacity was pre-initialized by codegen with the exact count
// of components that override loop(), computed at C++ compile time.
// Add all components with loop override that aren't already LOOP_DONE
// Some components (like logger) may call disable_loop() during initialization
// before setup runs, so we need to respect their LOOP_DONE state
this->add_looping_components_by_state_(false);
this->looping_components_active_end_ = this->looping_components_.size();
// Then add any components that are already LOOP_DONE to the inactive section
// This handles components that called disable_loop() during initialization
this->add_looping_components_by_state_(true);
}
void add_looping_components_by_state_(bool match_loop_done);
// These methods are called by Component::disable_loop() and Component::enable_loop()