mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:27:46 +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
|
@ -275,7 +275,7 @@ ErrorOr<FileTransferDataMessage> FileTransferDataMessage::read_from_stream(AK::S
|
|||
auto contents = TRY(ByteBuffer::create_uninitialized(size));
|
||||
TRY(stream.read_until_filled(contents));
|
||||
|
||||
return FileTransferDataMessage(id, contents);
|
||||
return FileTransferDataMessage(id, move(contents));
|
||||
}
|
||||
|
||||
ErrorOr<String> FileTransferDataMessage::debug_description()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue