Make LinkedList::prepend() also set the element as the last one if we have no elements
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2022-12-17 15:28:18 +01:00
parent f5de9c5589
commit e4b971f09c
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -85,6 +85,7 @@ template <typename T> class DoublyLinkedList
void prepend(T* ptr)
{
Node* const node = extract_node(ptr);
if (!m_end_node) m_end_node = node;
if (m_start_node) node->prepend_to_list(m_start_node);
else
{