mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
AK: Add Queue::head()
This returns a const T& for the first element in the queue, without dequeuing it.
This commit is contained in:
parent
c1d3ac7108
commit
78a744da77
Notes:
sideshowbarker
2024-07-19 11:27:23 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/78a744da776
1 changed files with 6 additions and 0 deletions
|
@ -40,6 +40,12 @@ public:
|
|||
return value;
|
||||
}
|
||||
|
||||
const T& head() const
|
||||
{
|
||||
ASSERT(!is_empty());
|
||||
return (*m_segments.first())[m_index_into_first];
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
m_segments.clear();
|
||||
|
|
Loading…
Reference in a new issue