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])
| 443 | /// appears once, at its first occurrence. Iterating manifests root→leaf |
| 444 | /// therefore yields parents' changes before children's own suffixes. |
| 445 | pub 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 |