mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 00:30:50 +08:00
refactor(platform): out-line ModuleParams::updateParams() to save flash (#29543)
The base implementation, which walks the child list and then calls updateParamsImpl(), was defined in the class body. Every module that calls updateParams() on a parameter update therefore inlined the list walk. Define it in module_params.cpp next to setParent(). px4_fmu-v6x_default: 1917160 -> 1915056 bytes of text, -2104 B. Assisted-by: Claude:claude-fable-5-1 Co-authored-by: Balduin <balduin@auterion.com>
This commit is contained in:
1 parent
5602762081
commit
9c1e218b1f
2 files changed
+10
-8
No files matched your search
@@ -42,6 +42,15 @@ void ModuleParams::setParent(ModuleParams *parent)
|
||||
_parent = parent;
|
||||
}
|
||||
|
||||
void ModuleParams::updateParams()
|
||||
{
|
||||
for (const auto &child : _children) {
|
||||
child->updateParams();
|
||||
}
|
||||
|
||||
updateParamsImpl();
|
||||
}
|
||||
|
||||
ModuleParams::~ModuleParams()
|
||||
{
|
||||
if (_parent) { _parent->_children.remove(this); }
|
||||
|
||||
Reference in new issue
Block a user