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

Function merge_candidate

libatomic/src/daemon/services_agent.rs:100–121  ·  view source on GitHub ↗
(
        candidates: &mut HashMap<String, CandidateScore>,
        node_id: &str,
        path: Option<String>,
        base: f64,
        neighbor: bool,
    )

Source from the content-addressed store, hash-verified

98 }
99
100 pub fn merge_candidate(
101 candidates: &mut HashMap<String, CandidateScore>,
102 node_id: &str,
103 path: Option<String>,
104 base: f64,
105 neighbor: bool,
106 ) {
107 candidates
108 .entry(node_id.to_string())
109 .and_modify(|candidate| {
110 candidate.base = candidate.base.max(base);
111 candidate.neighbor |= neighbor;
112 if candidate.path.is_none() {
113 candidate.path = path.clone();
114 }
115 })
116 .or_insert(CandidateScore {
117 base,
118 neighbor,
119 path,
120 });
121 }
122
123 /// Add all memory nodes adjacent to `node_id` as neighbor candidates.
124 fn add_memory_neighbors(

Callers 3

add_memory_neighborsFunction · 0.70
gather_candidatesFunction · 0.70
scan_memory_bodiesFunction · 0.70

Calls 2

is_noneMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected