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

Method merge

atomic-core/src/change/credit.rs:518–531  ·  view source on GitHub ↗

Merge another stats into this one.

(&mut self, other: &CreditStats)

Source from the content-addressed store, hash-verified

516
517 /// Merge another stats into this one.
518 pub fn merge(&mut self, other: &CreditStats) {
519 self.total_lines += other.total_lines;
520 self.human_lines += other.human_lines;
521 self.ai_assisted_lines += other.ai_assisted_lines;
522 self.collaborative_lines += other.collaborative_lines;
523 self.ai_generated_lines += other.ai_generated_lines;
524 self.unknown_lines += other.unknown_lines;
525
526 for vendor in &other.ai_vendors {
527 if !self.ai_vendors.contains(vendor) {
528 self.ai_vendors.push(vendor.clone());
529 }
530 }
531 }
532}
533
534impl fmt::Display for CreditStats {

Callers 1

test_credit_stats_mergeFunction · 0.45

Calls 3

containsMethod · 0.45
pushMethod · 0.45
cloneMethod · 0.45

Tested by 1

test_credit_stats_mergeFunction · 0.36