mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 18:32:28 -05:00
LibCompress: Remove two needless heap allocations
This commit is contained in:
parent
88d64fcb55
commit
c3b8b3124c
1 changed files with 3 additions and 2 deletions
|
@ -362,8 +362,9 @@ void DeflateDecompressor::close()
|
|||
|
||||
ErrorOr<ByteBuffer> DeflateDecompressor::decompress_all(ReadonlyBytes bytes)
|
||||
{
|
||||
auto memory_stream = TRY(try_make<FixedMemoryStream>(bytes));
|
||||
auto deflate_stream = TRY(DeflateDecompressor::construct(make<LittleEndianInputBitStream>(move(memory_stream))));
|
||||
FixedMemoryStream memory_stream { bytes };
|
||||
LittleEndianInputBitStream bit_stream { MaybeOwned<Stream>(memory_stream) };
|
||||
auto deflate_stream = TRY(DeflateDecompressor::construct(MaybeOwned<LittleEndianInputBitStream>(bit_stream)));
|
||||
AllocatingMemoryStream output_stream;
|
||||
|
||||
auto buffer = TRY(ByteBuffer::create_uninitialized(4096));
|
||||
|
|
Loading…
Add table
Reference in a new issue