mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-22 09:12:13 -05:00
AK: Add offset() method to Span.
This commit is contained in:
parent
a922abd9d7
commit
8d2dba022e
Notes:
sideshowbarker
2024-07-19 04:32:47 +09:00
Author: https://github.com/asynts Commit: https://github.com/SerenityOS/serenity/commit/8d2dba022eb Pull-request: https://github.com/SerenityOS/serenity/pull/2903
1 changed files with 6 additions and 0 deletions
|
@ -150,6 +150,12 @@ public:
|
|||
return { this->m_values + start, size };
|
||||
}
|
||||
|
||||
ALWAYS_INLINE T* offset(size_t start) const
|
||||
{
|
||||
ASSERT(start < this->m_size);
|
||||
return this->m_values + start;
|
||||
}
|
||||
|
||||
ALWAYS_INLINE const T& at(size_t index) const
|
||||
{
|
||||
ASSERT(index < this->m_size);
|
||||
|
|
Loading…
Reference in a new issue