mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:38:11 +00:00
FileSystemAccessServer: Only compute basename when prompting
pvs-studio flagged this as a potential performance optimization, we only need to compute the basename when it's used.
This commit is contained in:
parent
677f227774
commit
4a53c66b7f
1 changed files with 1 additions and 1 deletions
|
@ -75,11 +75,11 @@ void ClientConnection::request_file_handler(i32 window_server_client_id, i32 par
|
|||
auto pid = this->socket().peer_pid();
|
||||
auto exe_link = LexicalPath("/proc").append(String::number(pid)).append("exe").string();
|
||||
auto exe_path = Core::File::real_path_for(exe_link);
|
||||
auto exe_name = LexicalPath::basename(exe_path);
|
||||
|
||||
auto main_window = create_dummy_child_window(window_server_client_id, parent_window_id);
|
||||
|
||||
if (prompt == ShouldPrompt::Yes) {
|
||||
auto exe_name = LexicalPath::basename(exe_path);
|
||||
auto result = GUI::MessageBox::show(main_window, String::formatted("Allow {} ({}) to {} \"{}\"?", exe_name, pid, access_string, path), "File Permissions Requested", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::YesNo);
|
||||
approved = result == GUI::MessageBox::ExecYes;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue