mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:48:12 +00:00
AK: Make String::substring() return non-null for 0-length strings
This also makes String::split() give non-null strings when keep_empty is true.
This commit is contained in:
parent
9dcbb263f1
commit
e57a432118
2 changed files with 26 additions and 1 deletions
|
@ -125,7 +125,7 @@ String String::isolated_copy() const
|
|||
String String::substring(size_t start, size_t length) const
|
||||
{
|
||||
if (!length)
|
||||
return {};
|
||||
return "";
|
||||
ASSERT(m_impl);
|
||||
ASSERT(start + length <= m_impl->length());
|
||||
// FIXME: This needs some input bounds checking.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue