mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-09 05:57:31 +00:00
AK: Add Queue::tail()
We already had head(), so let's also have tail().
This commit is contained in:
parent
479e269c8b
commit
f8c075f2b1
|
@ -62,6 +62,12 @@ public:
|
|||
return m_segments.first()->data[m_index_into_first];
|
||||
}
|
||||
|
||||
T& tail()
|
||||
{
|
||||
VERIFY(!is_empty());
|
||||
return m_segments.last()->data.last();
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
while (auto* segment = m_segments.take_first())
|
||||
|
|
Loading…
Reference in New Issue
Block a user