mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:47:45 +00:00
AK: Add InlineLinkedList::remove_tail().
This commit is contained in:
parent
11b99dd89a
commit
19eeaf807d
1 changed files with 9 additions and 0 deletions
|
@ -52,6 +52,7 @@ public:
|
||||||
|
|
||||||
T* head() const { return m_head; }
|
T* head() const { return m_head; }
|
||||||
T* remove_head();
|
T* remove_head();
|
||||||
|
T* remove_tail();
|
||||||
|
|
||||||
T* tail() const { return m_tail; }
|
T* tail() const { return m_tail; }
|
||||||
|
|
||||||
|
@ -151,6 +152,14 @@ template<typename T> inline T* InlineLinkedList<T>::remove_head()
|
||||||
return node;
|
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)
|
template<typename T> inline void InlineLinkedList<T>::append(InlineLinkedList<T>& other)
|
||||||
{
|
{
|
||||||
if (!other.head())
|
if (!other.head())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue