1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:57:44 +00:00

AK+LibCompress: Remove the Deflate back-reference intermediate buffer

Instead of reading bytes from the output stream into a buffer, just to
immediately write them back out, we can skip the middle-man and copy the
bytes directly into the output buffer.
This commit is contained in:
Timothy Flynn 2023-03-30 14:02:22 -04:00 committed by Andreas Kling
parent 9f238793e0
commit 8b56d82865
3 changed files with 19 additions and 3 deletions

View file

@ -33,6 +33,8 @@ public:
/// before the current write pointer and allows for reading already-read data.
ErrorOr<Bytes> read_with_seekback(Bytes bytes, size_t distance);
ErrorOr<void> copy_from_seekback(size_t distance, size_t length);
[[nodiscard]] size_t empty_space() const;
[[nodiscard]] size_t used_space() const;
[[nodiscard]] size_t capacity() const;