mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 12:23:15 +00:00
AK: Add InlineLinkedList::remove_tail().
This commit is contained in:
parent
11b99dd89a
commit
19eeaf807d
|
@ -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())
|
||||
|
|
Loading…
Reference in a new issue