diff --git a/AK/InlineLinkedList.h b/AK/InlineLinkedList.h index 5773e922327..a6156c42840 100644 --- a/AK/InlineLinkedList.h +++ b/AK/InlineLinkedList.h @@ -52,6 +52,7 @@ public: T* head() const { return m_head; } T* remove_head(); + T* remove_tail(); T* tail() const { return m_tail; } @@ -151,6 +152,14 @@ template inline T* InlineLinkedList::remove_head() return node; } +template inline T* InlineLinkedList::remove_tail() +{ + T* node = tail(); + if (node) + remove(node); + return node; +} + template inline void InlineLinkedList::append(InlineLinkedList& other) { if (!other.head())