1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 17:15:08 +00:00

Userland: Don't use String::from_utf8() for literal strings

This commit is contained in:
Tim Ledbetter 2023-09-14 17:57:11 +01:00 committed by Andreas Kling
parent 4cc3c41269
commit c74f7e5f2a
8 changed files with 15 additions and 15 deletions

View file

@ -87,7 +87,7 @@ ErrorOr<NonnullRefPtr<DeviceNodeFamily>> DeviceEventLoop::find_or_register_new_d
static ErrorOr<String> build_suffix_with_letters(size_t allocation_index)
{
auto base_string = TRY(String::from_utf8(""sv));
String base_string {};
while (true) {
base_string = TRY(String::formatted("{:c}{}", 'a' + (allocation_index % 26), base_string));
allocation_index = (allocation_index / 26);