Method
add
(&mut self, actual: u64, predicted: u64)
Source from the content-addressed store, hash-verified
| 11 | } |
| 12 | impl Exceptions { |
| 13 | fn add(&mut self, actual: u64, predicted: u64) -> FormatResult<()> { |
| 14 | let n = self.count as usize; |
| 15 | if n.is_multiple_of(8) { |
| 16 | self.mask.push(0); |
| 17 | } |
| 18 | if actual != predicted { |
| 19 | self.mask[n / 8] |= 1 << (n % 8); |
| 20 | put(&mut self.values, actual); |
| 21 | } |
| 22 | self.count = self |
| 23 | .count |
| 24 | .checked_add(1) |
| 25 | .ok_or(FormatError::SemanticLimitExceeded)?; |
| 26 | Ok(()) |
| 27 | } |
| 28 | } |
| 29 | struct Encoder<'a> { |
| 30 | input: &'a [u8], |
Tested by
no test coverage detected