mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
Everywhere: Rename ASSERT => VERIFY
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
This commit is contained in:
@@ -104,7 +104,7 @@ String String::empty()
|
||||
bool String::copy_characters_to_buffer(char* buffer, size_t buffer_size) const
|
||||
{
|
||||
// We must fit at least the NUL-terminator.
|
||||
ASSERT(buffer_size > 0);
|
||||
VERIFY(buffer_size > 0);
|
||||
|
||||
size_t characters_to_copy = min(length(), buffer_size - 1);
|
||||
__builtin_memcpy(buffer, characters(), characters_to_copy);
|
||||
@@ -127,8 +127,8 @@ String String::isolated_copy() const
|
||||
|
||||
String String::substring(size_t start) const
|
||||
{
|
||||
ASSERT(m_impl);
|
||||
ASSERT(start <= length());
|
||||
VERIFY(m_impl);
|
||||
VERIFY(start <= length());
|
||||
return { characters() + start, length() - start };
|
||||
}
|
||||
|
||||
@@ -136,24 +136,24 @@ String String::substring(size_t start, size_t length) const
|
||||
{
|
||||
if (!length)
|
||||
return "";
|
||||
ASSERT(m_impl);
|
||||
ASSERT(start + length <= m_impl->length());
|
||||
VERIFY(m_impl);
|
||||
VERIFY(start + length <= m_impl->length());
|
||||
// FIXME: This needs some input bounds checking.
|
||||
return { characters() + start, length };
|
||||
}
|
||||
|
||||
StringView String::substring_view(size_t start, size_t length) const
|
||||
{
|
||||
ASSERT(m_impl);
|
||||
ASSERT(start + length <= m_impl->length());
|
||||
VERIFY(m_impl);
|
||||
VERIFY(start + length <= m_impl->length());
|
||||
// FIXME: This needs some input bounds checking.
|
||||
return { characters() + start, length };
|
||||
}
|
||||
|
||||
StringView String::substring_view(size_t start) const
|
||||
{
|
||||
ASSERT(m_impl);
|
||||
ASSERT(start <= length());
|
||||
VERIFY(m_impl);
|
||||
VERIFY(start <= length());
|
||||
return { characters() + start, length() - start };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user