mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-22 02:26:11 +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];
|
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…
Reference in a new issue