mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09: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
Notes:
sideshowbarker
2024-07-17 01:46:43 +09:00
Author: https://github.com/BenWiederhake
Commit: 0ee5a4e308
Pull-request: https://github.com/SerenityOS/serenity/pull/18928
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