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

Function change_union

atomic-cli/src/commands/clone/helpers.rs:445–456  ·  view source on GitHub ↗

The union of change hashes across a set of manifests. Changes are content-addressed and shared across views (a draft's log includes its inherited prefix), so the union is deduplicated: each hash appears once, at its first occurrence. Iterating manifests root→leaf therefore yields parents' changes before children's own suffixes.

(manifests: &[ViewManifest])

Source from the content-addressed store, hash-verified

443/// appears once, at its first occurrence. Iterating manifests root→leaf
444/// therefore yields parents' changes before children's own suffixes.
445pub fn change_union(manifests: &[ViewManifest]) -> Vec<Hash> {
446 let mut seen: HashSet<Hash> = HashSet::new();
447 let mut union = Vec::new();
448 for manifest in manifests {
449 for hash in &manifest.changes {
450 if seen.insert(*hash) {
451 union.push(*hash);
452 }
453 }
454 }
455 union
456}
457
458// Inventory Support Detection
459

Callers 3

run_asyncMethod · 0.85

Calls 2

insertMethod · 0.45
pushMethod · 0.45