(&mut self)
| 28 | |
| 29 | impl Dictionary { |
| 30 | pub fn compute_weights(&mut self) { |
| 31 | if self.weights.is_some() || self.entries.is_empty() || !ENABLE_DICTIONARY_WEIGHTS { |
| 32 | return; |
| 33 | } |
| 34 | self.weights = weight_dictionary_by_frequent_items(&self.entries); |
| 35 | } |
| 36 | |
| 37 | pub fn choose<R: Rng>(&self, rng: &mut R) -> Option<(&[u8], u8)> { |
| 38 | let index = match ENABLE_DICTIONARY_WEIGHTS { |
no test coverage detected