update main #1

Merged
Sinipelto merged 240 commits from Bananymous/banan-os:main into main 2023-11-20 13:20:51 +02:00
1 changed files with 4 additions and 1 deletions
Showing only changes of commit fda4a4ad24 - Show all commits

View File

@ -87,9 +87,12 @@ namespace BAN
return *reinterpret_cast<S*>(m_data); return *reinterpret_cast<S*>(m_data);
} }
ByteSpanGeneral slice(size_type offset, size_type length) ByteSpanGeneral slice(size_type offset, size_type length = size_type(-1))
{ {
ASSERT(m_data); ASSERT(m_data);
ASSERT(m_size >= offset);
if (length == size_type(-1))
length = m_size - offset;
ASSERT(m_size >= offset + length); ASSERT(m_size >= offset + length);
return ByteSpanGeneral(m_data + offset, length); return ByteSpanGeneral(m_data + offset, length);
} }