From 8d2dba022ebb3e331cda550f87bfea3464507849 Mon Sep 17 00:00:00 2001 From: asynts Date: Mon, 27 Jul 2020 15:19:29 +0200 Subject: [PATCH] AK: Add offset() method to Span. --- AK/Span.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AK/Span.h b/AK/Span.h index ecdf57af24..d2258572e4 100644 --- a/AK/Span.h +++ b/AK/Span.h @@ -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);