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

Method deletions

atomic-core/src/diff/word.rs:379–388  ·  view source on GitHub ↗

Count the number of deleted tokens.

(&self)

Source from the content-addressed store, hash-verified

377
378 /// Count the number of deleted tokens.
379 pub fn deletions(&self) -> usize {
380 self.ops
381 .iter()
382 .map(|op| match op {
383 WordDiffOp::Delete { old_range, .. } => old_range.len(),
384 WordDiffOp::Replace { old_range, .. } => old_range.len(),
385 _ => 0,
386 })
387 .sum()
388 }
389
390 /// Get the edit distance (number of token changes).
391 ///

Callers 1

edit_distanceMethod · 0.45

Calls 2

iterMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected