1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 01:47:34 +00:00

AK: Move parts for searching CircularBuffer into a new class

We will be adding extra logic to the CircularBuffer to optimize
searching, but this would negatively impact the performance of
CircularBuffer users that don't need that functionality.
This commit is contained in:
Tim Schumacher 2023-06-01 20:48:35 +02:00 committed by Linus Groh
parent 40c0dd67dd
commit 9e82ad758e
6 changed files with 50 additions and 16 deletions

View file

@ -229,7 +229,7 @@ public:
virtual ~LzmaCompressor();
private:
LzmaCompressor(MaybeOwned<Stream>, LzmaCompressorOptions, MaybeOwned<CircularBuffer>, FixedArray<Probability> literal_probabilities);
LzmaCompressor(MaybeOwned<Stream>, LzmaCompressorOptions, MaybeOwned<SearchableCircularBuffer>, FixedArray<Probability> literal_probabilities);
ErrorOr<void> shift_range_encoder();
ErrorOr<void> normalize_range_encoder();
@ -255,7 +255,7 @@ private:
// This doubles as an input buffer, which is appended at the very front of the buffer.
// Therefore, the size of this should at least be the dictionary size + the largest possible repetition length.
MaybeOwned<CircularBuffer> m_dictionary;
MaybeOwned<SearchableCircularBuffer> m_dictionary;
// Range encoder state.
u32 m_range_encoder_range { 0xFFFFFFFF };