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

Method compute_stats

atomic-repository/src/diff_engine.rs:640–656  ·  view source on GitHub ↗

Update statistics based on hunks.

(&mut self)

Source from the content-addressed store, hash-verified

638
639 /// Update statistics based on hunks.
640 pub fn compute_stats(&mut self) {
641 let mut insertions = 0;
642 let mut deletions = 0;
643
644 for graph_op in &self.hunks {
645 for line in &graph_op.lines {
646 match line.status {
647 LineStatus::Added => insertions += 1,
648 LineStatus::Removed => deletions += 1,
649 LineStatus::Unchanged => {}
650 }
651 }
652 }
653
654 self.stats.insertions = insertions;
655 self.stats.deletions = deletions;
656 }
657
658 /// Get the display path for the file.
659 pub fn display_path(&self) -> &str {

Callers 3

change_file_diffsFunction · 0.45
change_file_diffs_withFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected