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:
parent
67d9172885
commit
0ee5a4e308
5 changed files with 13 additions and 8 deletions
|
@ -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 {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue