mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-04 08:36:12 +00:00
LibCompress: Replace usages of the Endian bytes accessor
This commit is contained in:
parent
8370377832
commit
e11e7309dd
Notes:
sideshowbarker
2024-07-17 05:03:11 +09:00
Author: https://github.com/timschumi
Commit: e11e7309dd
Pull-request: https://github.com/SerenityOS/serenity/pull/18311
Reviewed-by: https://github.com/trflynn89 ✅
3 changed files with 5 additions and 9 deletions
|
@ -231,10 +231,8 @@ ErrorOr<size_t> GzipCompressor::write_some(ReadonlyBytes bytes)
|
|||
TRY(compressed_stream->final_flush());
|
||||
Crypto::Checksum::CRC32 crc32;
|
||||
crc32.update(bytes);
|
||||
LittleEndian<u32> digest = crc32.digest();
|
||||
LittleEndian<u32> size = bytes.size();
|
||||
TRY(m_output_stream->write_until_depleted(digest.bytes()));
|
||||
TRY(m_output_stream->write_until_depleted(size.bytes()));
|
||||
TRY(m_output_stream->write_value<LittleEndian<u32>>(crc32.digest()));
|
||||
TRY(m_output_stream->write_value<LittleEndian<u32>>(bytes.size()));
|
||||
return bytes.size();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue