AK: Add Queue::tail()
We already had head(), so let's also have tail().
This commit is contained in:
parent
479e269c8b
commit
f8c075f2b1
Notes:
sideshowbarker
2024-07-17 00:27:16 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/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];
|
||||
}
|
||||
|
||||
T& tail()
|
||||
{
|
||||
VERIFY(!is_empty());
|
||||
return m_segments.last()->data.last();
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
while (auto* segment = m_segments.take_first())
|
||||
|
|
Loading…
Add table
Reference in a new issue