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

@ -740,7 +740,7 @@ Optional<Vector<CodeComprehension::AutocompleteResultEntry>> CppComprehensionEng
// FIXME: Don't dismiss the autocomplete when filling these suggestions.
auto completion = String::formatted("{}{}{}/", prefix, include_dir, path);
options.empend(completion, include_dir.length() + partial_basename.length() + 1, CodeComprehension::Language::Cpp, path, CodeComprehension::AutocompleteResultEntry::HideAutocompleteAfterApplying::No);
} else if (path.ends_with(".h")) {
} else if (path.ends_with(".h"sv)) {
// FIXME: Place the cursor after the trailing > or ", even if it was
// already typed.
auto completion = String::formatted("{}{}{}{}", prefix, include_dir, path, already_has_suffix ? "" : suffix);
@ -784,7 +784,7 @@ CppComprehensionEngine::SymbolName CppComprehensionEngine::SymbolName::create(St
CppComprehensionEngine::SymbolName CppComprehensionEngine::SymbolName::create(StringView qualified_name)
{
auto parts = qualified_name.split_view("::");
auto parts = qualified_name.split_view("::"sv);
VERIFY(!parts.is_empty());
auto name = parts.take_last();
return SymbolName::create(name, move(parts));