diff --git a/include/blt/std/queues.h b/include/blt/std/queues.h index 73ff529..4d8150e 100644 --- a/include/blt/std/queues.h +++ b/include/blt/std/queues.h @@ -31,13 +31,10 @@ namespace BLT { public: void insert(const T& t) { - auto newNode = new node(t, nullptr); if (head == nullptr) - head = newNode; - else { - newNode->next = head; - head = newNode; - } + head = new node(t, nullptr); + else + head = new node(t, head); } [[nodiscard]] const T& front() const {