1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:37:35 +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

@ -36,7 +36,7 @@ struct ClassViewNode {
NonnullOwnPtrVector<ClassViewNode> children;
ClassViewNode* parent { nullptr };
explicit ClassViewNode(const StringView& name)
explicit ClassViewNode(StringView name)
: name(name) {};
};

View file

@ -138,7 +138,7 @@ void EvaluateExpressionDialog::handle_evaluation(const String& expression)
set_output(JS::MarkupGenerator::html_from_value(m_interpreter->vm().last_value()));
}
void EvaluateExpressionDialog::set_output(const StringView& html)
void EvaluateExpressionDialog::set_output(StringView html)
{
auto paragraph = m_output_container->document().create_element("p");
paragraph->set_inner_html(html);

View file

@ -19,7 +19,7 @@ private:
void build(Window* parent_window);
void handle_evaluation(const String& expression);
void set_output(const StringView& html);
void set_output(StringView html);
NonnullOwnPtr<JS::Interpreter> m_interpreter;
RefPtr<GUI::TextBox> m_text_editor;

View file

@ -89,7 +89,7 @@ static String variable_value_as_string(const Debug::DebugInfo::VariableInfo& var
return String::formatted("type: {} @ {:p}, ", variable.type_name, variable_address);
}
static Optional<u32> string_to_variable_value(const StringView& string_value, const Debug::DebugInfo::VariableInfo& variable)
static Optional<u32> string_to_variable_value(StringView string_value, const Debug::DebugInfo::VariableInfo& variable)
{
if (variable.is_enum_type()) {
auto prefix_string = String::formatted("{}::", variable.type_name);
@ -124,7 +124,7 @@ static Optional<u32> string_to_variable_value(const StringView& string_value, co
return {};
}
void VariablesModel::set_variable_value(const GUI::ModelIndex& index, const StringView& string_value, GUI::Window* parent_window)
void VariablesModel::set_variable_value(const GUI::ModelIndex& index, StringView string_value, GUI::Window* parent_window)
{
auto variable = static_cast<const Debug::DebugInfo::VariableInfo*>(index.internal_data());

View file

@ -18,7 +18,7 @@ class VariablesModel final : public GUI::Model {
public:
static RefPtr<VariablesModel> create(const PtraceRegisters& regs);
void set_variable_value(const GUI::ModelIndex&, const StringView&, GUI::Window*);
void set_variable_value(const GUI::ModelIndex&, StringView, GUI::Window*);
virtual int row_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override;
virtual int column_count(const GUI::ModelIndex& = GUI::ModelIndex()) const override { return 1; }

View file

@ -89,7 +89,7 @@ private:
Vector<Match> m_matches;
};
static RefPtr<SearchResultsModel> find_in_files(const StringView& text)
static RefPtr<SearchResultsModel> find_in_files(StringView text)
{
Vector<Match> matches;
project().for_each_text_file([&](auto& file) {

View file

@ -31,7 +31,7 @@ class ServerConnection
friend class ServerConnectionWrapper;
public:
ServerConnection(const StringView& socket, const String& project_path)
ServerConnection(StringView socket, const String& project_path)
: IPC::ServerConnection<LanguageClientEndpoint, LanguageServerEndpoint>(*this, socket)
{
m_project_path = project_path;

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);