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

Method candidates

atomic-core/src/record/workflow/recipes/content_hash.rs:76–79  ·  view source on GitHub ↗

Return all positions that hash to the same value as `line`. Returns an empty slice if no match. Callers must verify content equality before treating a hash hit as a definite match (FNV-1a has rare collisions).

(&self, line: &[u8])

Source from the content-addressed store, hash-verified

74 /// equality before treating a hash hit as a definite match (FNV-1a
75 /// has rare collisions).
76 pub fn candidates(&self, line: &[u8]) -> &[usize] {
77 let h = hash_line(line);
78 self.buckets.get(&h).map(Vec::as_slice).unwrap_or(&[])
79 }
80
81 /// Consume one candidate position for `line` — pops the first
82 /// remaining position from the bucket. Used when matching is

Callers

nothing calls this directly

Calls 2

hash_lineFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected