BAN: Better ASSERT()

This commit is contained in:
2023-01-10 17:43:18 +02:00
parent 73cd08fa51
commit 1a65ea977d
5 changed files with 21 additions and 20 deletions

View File

@@ -25,7 +25,7 @@ namespace BAN
char StringView::operator[](size_type index) const
{
assert(index < m_size);
ASSERT(index < m_size);
return m_data[index];
}
@@ -52,10 +52,10 @@ namespace BAN
StringView StringView::Substring(size_type index, size_type len) const
{
assert(index <= m_size);
ASSERT(index <= m_size);
if (len == size_type(-1))
len = m_size - index;
assert(len <= m_size - index); // weird order to avoid overflow
ASSERT(len <= m_size - index); // weird order to avoid overflow
StringView result;
result.m_data = m_data + index;
result.m_size = len;