AK: Add InlineLinkedList::remove_tail().

This commit is contained in:
Andreas Kling 2019-05-07 16:06:48 +02:00
parent 11b99dd89a
commit 19eeaf807d
Notes: sideshowbarker 2024-07-19 14:12:36 +09:00

View file

@ -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<typename T> inline T* InlineLinkedList<T>::remove_head()
return node;
}
template<typename T> inline T* InlineLinkedList<T>::remove_tail()
{
T* node = tail();
if (node)
remove(node);
return node;
}
template<typename T> inline void InlineLinkedList<T>::append(InlineLinkedList<T>& other)
{
if (!other.head())