1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:37:46 +00:00

Everywhere: Pass AK::StringView by value

This commit is contained in:
Andreas Kling 2021-11-11 00:55:02 +01:00
parent ad5d217e76
commit 8b1108e485
392 changed files with 978 additions and 978 deletions

View file

@ -355,12 +355,12 @@ Vector<CppComprehensionEngine::Symbol> CppComprehensionEngine::get_child_symbols
return symbols;
}
String CppComprehensionEngine::document_path_from_include_path(const StringView& include_path) const
String CppComprehensionEngine::document_path_from_include_path(StringView include_path) const
{
static Regex<PosixExtended> library_include("<(.+)>");
static Regex<PosixExtended> user_defined_include("\"(.+)\"");
auto document_path_for_library_include = [&](const StringView& include_path) -> String {
auto document_path_for_library_include = [&](StringView include_path) -> String {
RegexResult result;
if (!library_include.search(include_path, result))
return {};
@ -369,7 +369,7 @@ String CppComprehensionEngine::document_path_from_include_path(const StringView&
return String::formatted("/usr/include/{}", path);
};
auto document_path_for_user_defined_include = [&](const StringView& include_path) -> String {
auto document_path_for_user_defined_include = [&](StringView include_path) -> String {
RegexResult result;
if (!user_defined_include.search(include_path, result))
return {};

View file

@ -117,7 +117,7 @@ private:
void set_document_data(const String& file, OwnPtr<DocumentData>&& data);
OwnPtr<DocumentData> create_document_data_for(const String& file);
String document_path_from_include_path(const StringView& include_path) const;
String document_path_from_include_path(StringView include_path) const;
void update_declared_symbols(DocumentData&);
void update_todo_entries(DocumentData&);
GUI::AutocompleteProvider::DeclarationType type_of_declaration(const Declaration&);

View file

@ -39,7 +39,7 @@ private:
void set_document_data(const String& file, OwnPtr<DocumentData>&& data);
OwnPtr<DocumentData> create_document_data_for(const String& file);
String document_path_from_include_path(const StringView& include_path) const;
String document_path_from_include_path(StringView include_path) const;
void update_declared_symbols(const DocumentData&);
static size_t resolve(const ShellComprehensionEngine::DocumentData& document, const GUI::TextPosition& position);