mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-08-16 08:50:26 +03:00
LibCompress/Lzw: Name a magic variable
This commit is contained in:
parent
945e09e46d
commit
ff33fa7e8b
Notes:
sideshowbarker
2024-07-16 18:26:46 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/ff33fa7e8b Pull-request: https://github.com/SerenityOS/serenity/pull/24191 Reviewed-by: https://github.com/nico ✅ Reviewed-by: https://github.com/timschumi
@ -44,6 +44,7 @@ public:
|
||||
|
||||
protected:
|
||||
static constexpr int max_code_size = 12;
|
||||
static constexpr int max_table_size = 1 << max_code_size;
|
||||
|
||||
LzwState(u8 min_code_size, i32 offset_for_size_change)
|
||||
: m_code_size(min_code_size)
|
||||
@ -65,7 +66,7 @@ protected:
|
||||
|
||||
void extend_code_table(Vector<u8> const& entry)
|
||||
{
|
||||
if (entry.size() > 1 && m_code_table.size() < 4096) {
|
||||
if (entry.size() > 1 && m_code_table.size() < max_table_size) {
|
||||
m_code_table.append(entry);
|
||||
if (m_code_table.size() >= (m_table_capacity + m_offset_for_size_change) && m_code_size < max_code_size) {
|
||||
++m_code_size;
|
||||
|
Loading…
Reference in New Issue
Block a user