mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibCompress: CanonicalCode: Don't leave unused code uninitialized.
This commit is contained in:
parent
8a2fd0e436
commit
ef7bec6a3b
Notes:
sideshowbarker
2024-07-19 02:57:59 +09:00
Author: https://github.com/asynts
Commit: ef7bec6a3b
Pull-request: https://github.com/SerenityOS/serenity/pull/3362
Reviewed-by: https://github.com/alimpfard
1 changed files with 2 additions and 7 deletions
|
@ -40,10 +40,6 @@ DeflateDecompressor::CanonicalCode::CanonicalCode(ReadonlyBytes codes)
|
||||||
{
|
{
|
||||||
// FIXME: I can't quite follow the algorithm here, but it seems to work.
|
// FIXME: I can't quite follow the algorithm here, but it seems to work.
|
||||||
|
|
||||||
m_symbol_codes.resize(codes.size());
|
|
||||||
m_symbol_values.resize(codes.size());
|
|
||||||
|
|
||||||
auto allocated_symbols_count = 0;
|
|
||||||
auto next_code = 0;
|
auto next_code = 0;
|
||||||
|
|
||||||
for (size_t code_length = 1; code_length <= 15; ++code_length) {
|
for (size_t code_length = 1; code_length <= 15; ++code_length) {
|
||||||
|
@ -59,10 +55,9 @@ DeflateDecompressor::CanonicalCode::CanonicalCode(ReadonlyBytes codes)
|
||||||
ASSERT_NOT_REACHED();
|
ASSERT_NOT_REACHED();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_symbol_codes[allocated_symbols_count] = start_bit | next_code;
|
m_symbol_codes.append(start_bit | next_code);
|
||||||
m_symbol_values[allocated_symbols_count] = symbol;
|
m_symbol_values.append(symbol);
|
||||||
|
|
||||||
allocated_symbols_count++;
|
|
||||||
next_code++;
|
next_code++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue