mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:57:47 +00:00
LibGUI: Avoid unnecessary copies of clipboard metadata
This commit is contained in:
parent
342e1c6eab
commit
592e6c89a5
1 changed files with 2 additions and 2 deletions
|
@ -59,7 +59,7 @@ Clipboard::DataAndType Clipboard::fetch_data_and_type() const
|
||||||
{
|
{
|
||||||
auto response = connection().get_clipboard_data();
|
auto response = connection().get_clipboard_data();
|
||||||
auto type = response.mime_type();
|
auto type = response.mime_type();
|
||||||
auto metadata = response.metadata();
|
auto& metadata = response.metadata();
|
||||||
|
|
||||||
auto metadata_clone_or_error = metadata.clone();
|
auto metadata_clone_or_error = metadata.clone();
|
||||||
if (metadata_clone_or_error.is_error())
|
if (metadata_clone_or_error.is_error())
|
||||||
|
@ -71,7 +71,7 @@ Clipboard::DataAndType Clipboard::fetch_data_and_type() const
|
||||||
if (data.is_error())
|
if (data.is_error())
|
||||||
return {};
|
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
|
RefPtr<Gfx::Bitmap> Clipboard::DataAndType::as_bitmap() const
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue