mixer: update to List<> container

This commit is contained in:
Daniel Agar
2019-11-22 15:00:25 -05:00
parent 79dc676c8f
commit cc7807c066
7 changed files with 59 additions and 111 deletions
+19 -2
View File
@@ -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)