1
0
Fork 0
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:
asynts 2020-09-08 16:49:05 +02:00 committed by Andreas Kling
parent 7e02cad476
commit 4af8eea56f
Notes: sideshowbarker 2024-07-19 02:46:23 +09:00
7 changed files with 22 additions and 20 deletions

View file

@ -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) {