mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibGUI: Avoid unnecessary copies of clipboard metadata
This commit is contained in:
parent
342e1c6eab
commit
592e6c89a5
Notes:
sideshowbarker
2024-07-17 04:03:27 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/592e6c89a5 Pull-request: https://github.com/SerenityOS/serenity/pull/19400
@ -59,7 +59,7 @@ Clipboard::DataAndType Clipboard::fetch_data_and_type() const
|
||||
{
|
||||
auto response = connection().get_clipboard_data();
|
||||
auto type = response.mime_type();
|
||||
auto metadata = response.metadata();
|
||||
auto& metadata = response.metadata();
|
||||
|
||||
auto metadata_clone_or_error = metadata.clone();
|
||||
if (metadata_clone_or_error.is_error())
|
||||
@ -71,7 +71,7 @@ Clipboard::DataAndType Clipboard::fetch_data_and_type() const
|
||||
if (data.is_error())
|
||||
return {};
|
||||
|
||||
return { data.release_value(), type, metadata };
|
||||
return { data.release_value(), type, metadata_clone_or_error.release_value() };
|
||||
}
|
||||
|
||||
RefPtr<Gfx::Bitmap> Clipboard::DataAndType::as_bitmap() const
|
||||
|
Loading…
Reference in New Issue
Block a user