1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:37:35 +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,9 +51,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
response = move(client->send_simple_command(IMAP::CommandType::Capability)->await().value().get<IMAP::SolidResponse>());
outln("[CAPABILITY] First capability: {}", response.data().capabilities().first());
bool idle_supported = !response.data().capabilities().find_if([](auto capability) { return capability.equals_ignoring_case("IDLE"); }).is_end();
bool idle_supported = !response.data().capabilities().find_if([](auto capability) { return capability.equals_ignoring_case("IDLE"sv); }).is_end();
response = client->list("", "*")->await().release_value();
response = client->list(""sv, "*"sv)->await().release_value();
outln("[LIST] First mailbox: {}", response.data().list_items().first().name);
auto mailbox = "Inbox"sv;
@ -70,7 +70,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
"This is a message just to say hello.\r\n"
"So, \"Hello\"."
};
auto promise = client->append("INBOX", move(message));
auto promise = client->append("INBOX"sv, move(message));
response = promise->await().release_value();
outln("[APPEND] Response: {}", response.response_text());
@ -85,7 +85,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto added_message = search_results.first();
outln("[SEARCH] Number of results: {}", search_results.size());
response = client->status("INBOX", { IMAP::StatusItemType::Recent, IMAP::StatusItemType::Messages })->await().release_value();
response = client->status("INBOX"sv, { IMAP::StatusItemType::Recent, IMAP::StatusItemType::Messages })->await().release_value();
outln("[STATUS] Recent items: {}", response.data().status_item().get(IMAP::StatusItemType::Recent));
for (auto item : search_results) {