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

Method add_hunk

atomic-core/src/record/workflow/graph_op/hunk.rs:413–422  ·  view source on GitHub ↗

Add a built graph_op to the result.

(&mut self, graph_op: BuiltHunk)

Source from the content-addressed store, hash-verified

411
412 /// Add a built graph_op to the result.
413 pub fn add_hunk(&mut self, graph_op: BuiltHunk) {
414 // Update statistics
415 if let Some((start, end)) = graph_op.content_range() {
416 // Rough estimate: count newlines would be better but this is a proxy
417 self.lines_inserted += (end - start) as usize;
418 }
419 self.lines_deleted += graph_op.deleted_line_count();
420
421 self.hunks.push(graph_op);
422 }
423
424 /// Record that hunks were combined.
425 pub fn record_combination(&mut self) {

Callers 8

test_build_result_hunksFunction · 0.45
test_build_result_iterFunction · 0.45
finishMethod · 0.45

Calls 3

deleted_line_countMethod · 0.80
content_rangeMethod · 0.45
pushMethod · 0.45