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

Function count_unique_paths

atomic-cli/src/commands/change/command.rs:542–550  ·  view source on GitHub ↗

Count unique paths affected by hunks.

(hunks: &[GraphOp<H>])

Source from the content-addressed store, hash-verified

540
541/// Count unique paths affected by hunks.
542pub(crate) fn count_unique_paths<H>(hunks: &[GraphOp<H>]) -> usize {
543 let mut paths = std::collections::HashSet::new();
544 for graph_op in hunks {
545 if let Some(path) = get_hunk_path(graph_op) {
546 paths.insert(path);
547 }
548 }
549 paths.len()
550}
551
552/// Get the path from a graph_op.
553fn get_hunk_path<H>(graph_op: &GraphOp<H>) -> Option<String> {

Callers

nothing calls this directly

Calls 3

get_hunk_pathFunction · 0.85
insertMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected