MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / dedup_binaries

Function dedup_binaries

crates/openshell-policy/src/merge.rs:822–834  ·  view source on GitHub ↗
(values: &mut Vec<NetworkBinary>)

Source from the content-addressed store, hash-verified

820}
821
822fn dedup_binaries(values: &mut Vec<NetworkBinary>) {
823 let mut deduped: Vec<NetworkBinary> = Vec::with_capacity(values.len());
824 for binary in std::mem::take(values) {
825 if let Some(existing) = deduped.iter_mut().find(|item| item.path == binary.path) {
826 if !is_advisor_proposed_binary(&binary) {
827 mark_user_declared_binary(existing);
828 }
829 } else {
830 deduped.push(binary);
831 }
832 }
833 *values = deduped;
834}
835
836fn is_advisor_proposed_binary(binary: &NetworkBinary) -> bool {
837 #[allow(deprecated)]

Callers 1

normalize_ruleFunction · 0.85

Calls 4

lenMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected