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

Function modified_indices

atomic-core/src/merge/three_way.rs:272–283  ·  view source on GitHub ↗

Collect the set of base indices that are modified (replaced or deleted).

(ops: &[EditOp])

Source from the content-addressed store, hash-verified

270
271/// Collect the set of base indices that are modified (replaced or deleted).
272fn modified_indices(ops: &[EditOp]) -> HashSet<usize> {
273 let mut set = HashSet::new();
274 for op in ops {
275 match op {
276 EditOp::Replace(idx, _) | EditOp::Delete(idx) => {
277 set.insert(*idx);
278 }
279 _ => {}
280 }
281 }
282 set
283}
284
285/// For a given base index, return the replacement content (if any).
286/// `None` means the token was deleted rather than replaced.

Callers 1

three_way_mergeFunction · 0.85

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected