mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:17:35 +00:00
SpiceAgent: Reduce copying of potentially large byte buffers
This moves buffers around instead of implicitly copying them, and marks the message types that hold these buffers as move-only.
This commit is contained in:
parent
b865277275
commit
36d61c01bc
3 changed files with 19 additions and 7 deletions
|
@ -91,8 +91,8 @@ ErrorOr<void> SpiceAgent::send_clipboard_contents(ClipboardDataType data_type)
|
|||
clipboard_data = TRY(Gfx::PNGWriter::encode(*bitmap));
|
||||
}
|
||||
|
||||
auto message = ClipboardMessage(data_type, clipboard_data);
|
||||
TRY(this->send_message(message));
|
||||
auto message = ClipboardMessage(data_type, move(clipboard_data));
|
||||
TRY(this->send_message(move(message)));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue