mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 22:43:35 +08:00
mixer: update to List<> container
This commit is contained in:
@@ -62,8 +62,25 @@ public:
|
||||
|
||||
void add(T newNode)
|
||||
{
|
||||
newNode->setSibling(getHead());
|
||||
_head = newNode;
|
||||
if (_head == nullptr) {
|
||||
// list is empty, add as head
|
||||
_head = newNode;
|
||||
return;
|
||||
|
||||
} else {
|
||||
// find last node and add to end
|
||||
T node = _head;
|
||||
|
||||
while (node != nullptr) {
|
||||
if (node->getSibling() == nullptr) {
|
||||
// found last node, now add newNode
|
||||
node->setSibling(newNode);
|
||||
return;
|
||||
}
|
||||
|
||||
node = node->getSibling();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool remove(T removeNode)
|
||||
|
||||
Reference in New Issue
Block a user