1
Fork 0
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:
Timothy Flynn 2023-05-21 13:48:04 -04:00 committed by Andreas Kling
parent b865277275
commit 36d61c01bc
3 changed files with 19 additions and 7 deletions

View file

@ -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 {};
}