1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:07:34 +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

@ -28,8 +28,8 @@ ErrorOr<void> TerminalWrapper::run_command(String const& command, Optional<Strin
{
if (m_pid != -1) {
GUI::MessageBox::show(window(),
"A command is already running in this TerminalWrapper",
"Can't run command",
"A command is already running in this TerminalWrapper"sv,
"Can't run command"sv,
GUI::MessageBox::Type::Error);
return {};
}
@ -94,7 +94,7 @@ ErrorOr<int> TerminalWrapper::setup_master_pseudoterminal(WaitForChildOnExit wai
if (WIFEXITED(wstatus)) {
m_terminal_widget->inject_string(String::formatted("\033[{};1m(Command exited with code {})\033[0m\r\n", wstatus == 0 ? 32 : 31, WEXITSTATUS(wstatus)));
} else if (WIFSTOPPED(wstatus)) {
m_terminal_widget->inject_string("\033[34;1m(Command stopped!)\033[0m\r\n");
m_terminal_widget->inject_string("\033[34;1m(Command stopped!)\033[0m\r\n"sv);
} else if (WIFSIGNALED(wstatus)) {
m_terminal_widget->inject_string(String::formatted("\033[34;1m(Command signaled with {}!)\033[0m\r\n", strsignal(WTERMSIG(wstatus))));
}