mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:24:58 +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
1 changed files with 6 additions and 0 deletions
|
@ -62,6 +62,12 @@ public:
|
||||||
return m_segments.first()->data[m_index_into_first];
|
return m_segments.first()->data[m_index_into_first];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
T& tail()
|
||||||
|
{
|
||||||
|
VERIFY(!is_empty());
|
||||||
|
return m_segments.last()->data.last();
|
||||||
|
}
|
||||||
|
|
||||||
void clear()
|
void clear()
|
||||||
{
|
{
|
||||||
while (auto* segment = m_segments.take_first())
|
while (auto* segment = m_segments.take_first())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue