From e4b971f09c8c3dd965c12aff5913e907a85b7685 Mon Sep 17 00:00:00 2001 From: apio Date: Sat, 17 Dec 2022 15:28:18 +0100 Subject: [PATCH] Make LinkedList::prepend() also set the element as the last one if we have no elements --- luna/include/luna/LinkedList.h | 1 + 1 file changed, 1 insertion(+) diff --git a/luna/include/luna/LinkedList.h b/luna/include/luna/LinkedList.h index aeb5a695..50615134 100644 --- a/luna/include/luna/LinkedList.h +++ b/luna/include/luna/LinkedList.h @@ -85,6 +85,7 @@ template 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 {