MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / add

Method add

atomic-core/src/change/format_v3/semantic/predictive/encode.rs:13–27  ·  view source on GitHub ↗
(&mut self, actual: u64, predicted: u64)

Source from the content-addressed store, hash-verified

11}
12impl 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}
29struct Encoder<'a> {
30 input: &'a [u8],

Callers 1

bytesMethod · 0.45

Calls 2

putFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected