1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:47:44 +00:00

Everywhere: Convert known short-strings to the infallible String factory

For now, this is limited to strings that are 3 bytes or less. We can use
7 bytes on 64-bit platforms, but we do not yet assume 64-bit for Lagom
hosts (e.g. wasm).
This commit is contained in:
Timothy Flynn 2023-01-20 07:45:02 -05:00 committed by Tim Flynn
parent d48266a420
commit f1de4f8872
7 changed files with 7 additions and 7 deletions

View file

@ -150,7 +150,7 @@ ErrorOr<String> UnsignedBigInteger::to_base(u16 N) const
{
VERIFY(N <= 36);
if (*this == UnsignedBigInteger { 0 })
return String::from_utf8("0"sv);
return String::from_utf8_short_string("0"sv);
StringBuilder builder;
UnsignedBigInteger temp(*this);