mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-06 13:35:03 +00:00
AK: Add a way to slice from the end of a span
This commit is contained in:
committed by
Ali Mohammad Pur
parent
477ab6dc4c
commit
c022b6d74e
@@ -128,6 +128,11 @@ public:
|
||||
VERIFY(start <= size());
|
||||
return { this->m_values + start, size() - start };
|
||||
}
|
||||
[[nodiscard]] ALWAYS_INLINE constexpr Span slice_from_end(size_t count) const
|
||||
{
|
||||
VERIFY(count <= size());
|
||||
return { this->m_values + size() - count, count };
|
||||
}
|
||||
|
||||
[[nodiscard]] ALWAYS_INLINE constexpr Span trim(size_t length) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user