diff options
Diffstat (limited to 'vendor/ruzstd/src/fse')
-rw-r--r-- | vendor/ruzstd/src/fse/fse_decoder.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/vendor/ruzstd/src/fse/fse_decoder.rs b/vendor/ruzstd/src/fse/fse_decoder.rs index 1847da728..21868ff84 100644 --- a/vendor/ruzstd/src/fse/fse_decoder.rs +++ b/vendor/ruzstd/src/fse/fse_decoder.rs @@ -1,7 +1,7 @@ use crate::decoding::bit_reader::BitReader; use crate::decoding::bit_reader_reverse::{BitReaderReversed, GetBitsError}; +use alloc::vec::Vec; -#[derive(Clone)] pub struct FSETable { pub decode: Vec<Entry>, //used to decode symbols, and calculate the next state @@ -113,6 +113,15 @@ impl FSETable { } } + pub fn reinit_from(&mut self, other: &Self) { + self.reset(); + self.symbol_counter.extend_from_slice(&other.symbol_counter); + self.symbol_probabilities + .extend_from_slice(&other.symbol_probabilities); + self.decode.extend_from_slice(&other.decode); + self.accuracy_log = other.accuracy_log; + } + pub fn reset(&mut self) { self.symbol_counter.clear(); self.symbol_probabilities.clear(); |