diff options
author | martinfalisse <martinmotteditfalisse@gmail.com> | 2023-05-08 13:17:16 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-05-08 14:47:52 +0200 |
commit | af26b76e0accf6eb7ef673b02501ba2c235a991b (patch) | |
tree | a28a8e5ccc14bb891e2023647c052f36159b37f7 | |
parent | 00e446facd37f0d6784a9ca4890d26167fd34514 (diff) | |
download | serenity-af26b76e0accf6eb7ef673b02501ba2c235a991b.zip |
LibWebView: Use Vector for arguments to WebContent
In a future commit will add some more conditional arguments to the
array and so it's easier to have it be a Vector.
-rw-r--r-- | Userland/Libraries/LibWebView/ViewImplementation.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWebView/ViewImplementation.cpp b/Userland/Libraries/LibWebView/ViewImplementation.cpp index 0686544921..7ad00295f4 100644 --- a/Userland/Libraries/LibWebView/ViewImplementation.cpp +++ b/Userland/Libraries/LibWebView/ViewImplementation.cpp @@ -152,7 +152,7 @@ ErrorOr<NonnullRefPtr<WebView::WebContentClient>> ViewImplementation::launch_web ErrorOr<void> result; for (auto const& path : candidate_web_content_paths) { constexpr auto callgrind_prefix_length = 3; - auto arguments_with_callgrind_prefix = Array { + auto arguments = Vector { "valgrind"sv, "--tool=callgrind"sv, "--instr-atstart=no"sv, @@ -160,11 +160,10 @@ ErrorOr<NonnullRefPtr<WebView::WebContentClient>> ViewImplementation::launch_web "--webcontent-fd-passing-socket"sv, webcontent_fd_passing_socket_string }; - auto arguments = arguments_with_callgrind_prefix.span(); if (enable_callgrind_profiling == EnableCallgrindProfiling::No) - arguments = arguments.slice(callgrind_prefix_length); + arguments.remove(0, callgrind_prefix_length); - result = Core::System::exec(arguments[0], arguments, Core::System::SearchInPath::Yes); + result = Core::System::exec(arguments[0], arguments.span(), Core::System::SearchInPath::Yes); if (!result.is_error()) break; } |