1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:28:12 +00:00

Clipboard: Avoid unnecessary IPC::Dictionary wrapper

We already have and use HashMap<DeprecatedString, DeprecatedString>
nearly everywhere, which is equivalent.
This commit is contained in:
Ben Wiederhake 2023-05-14 23:04:47 +02:00 committed by Andreas Kling
parent 67d9172885
commit 0ee5a4e308
5 changed files with 13 additions and 8 deletions

View file

@ -59,9 +59,14 @@ Clipboard::DataAndType Clipboard::fetch_data_and_type() const
{
auto response = connection().get_clipboard_data();
auto type = response.mime_type();
auto metadata = response.metadata().entries();
auto metadata = response.metadata();
auto metadata_clone_or_error = metadata.clone();
if (metadata_clone_or_error.is_error())
return {};
if (!response.data().is_valid())
return { {}, type, metadata };
return { {}, type, metadata_clone_or_error.release_value() };
auto data = ByteBuffer::copy(response.data().data<void>(), response.data().size());
if (data.is_error())
return {};