mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 01:51:03 +09:00
LibCompress: Return Optional from decompress_all method.
This commit is contained in:
parent
7e02cad476
commit
4af8eea56f
Notes:
sideshowbarker
2024-07-19 02:46:23 +09:00
Author: https://github.com/asynts
Commit: 4af8eea56f
Pull-request: https://github.com/SerenityOS/serenity/pull/3455
7 changed files with 22 additions and 20 deletions
|
@ -55,11 +55,17 @@ Zlib::Zlib(ReadonlyBytes data)
|
|||
m_data_bytes = data.slice(2, data.size() - 2 - 4);
|
||||
}
|
||||
|
||||
ByteBuffer Zlib::decompress()
|
||||
Optional<ByteBuffer> Zlib::decompress()
|
||||
{
|
||||
return DeflateDecompressor::decompress_all(m_data_bytes);
|
||||
}
|
||||
|
||||
Optional<ByteBuffer> Zlib::decompress_all(ReadonlyBytes bytes)
|
||||
{
|
||||
Zlib zlib { bytes };
|
||||
return zlib.decompress();
|
||||
}
|
||||
|
||||
u32 Zlib::checksum()
|
||||
{
|
||||
if (!m_checksum) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue