1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:57:43 +00:00

Everywhere: Add sv suffix to strings relying on StringView(char const*)

Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
This commit is contained in:
sin-ack 2022-07-11 17:32:29 +00:00 committed by Andreas Kling
parent e5f09ea170
commit 3f3f45580a
762 changed files with 8315 additions and 8316 deletions

View file

@ -51,7 +51,7 @@ int main(int argc, char** argv, char** env)
else
executable_path = Core::find_executable_in_path(arguments[0]);
if (executable_path.is_empty()) {
reportln("Cannot find executable for '{}'.", arguments[0]);
reportln("Cannot find executable for '{}'."sv, arguments[0]);
return 1;
}
@ -98,7 +98,7 @@ int main(int argc, char** argv, char** env)
return 1;
StringBuilder builder;
builder.append("(UE) ");
builder.append("(UE) "sv);
builder.append(LexicalPath::basename(arguments[0]));
if (set_process_name(builder.string_view().characters_without_null_termination(), builder.string_view().length()) < 0) {
perror("set_process_name");
@ -106,7 +106,7 @@ int main(int argc, char** argv, char** env)
}
int rc = pthread_setname_np(pthread_self(), builder.to_string().characters());
if (rc != 0) {
reportln("pthread_setname_np: {}", strerror(rc));
reportln("pthread_setname_np: {}"sv, strerror(rc));
return 1;
}