1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 16:15:10 +00:00

AK: Don't return null from String[View]::substring_view()

We expect the result to be usable with the
StringView::substring_view_starting_*_substring() methods.

See https://github.com/SerenityOS/serenity/pull/938
This commit is contained in:
Sergey Bugaev 2020-01-14 14:03:30 +03:00 committed by Andreas Kling
parent b553a86048
commit 7ad9bfbc68
2 changed files with 0 additions and 4 deletions

View file

@ -105,8 +105,6 @@ bool StringView::ends_with(const StringView& str) const
StringView StringView::substring_view(size_t start, size_t length) const
{
if (!length)
return {};
ASSERT(start + length <= m_length);
return { m_characters + start, length };
}