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

Method can_combine_with

atomic-core/src/record/workflow/graph_op/pending.rs:196–207  ·  view source on GitHub ↗
(&self, other: &Self, gap: usize)

Source from the content-addressed store, hash-verified

194 /// * `gap` - Maximum gap (in lines) to allow between changes
195 #[must_use]
196 pub fn can_combine_with(&self, other: &Self, gap: usize) -> bool {
197 // Check if changes are close enough in the old file
198 let self_old_end = self.old_start + self.old_len;
199 let other_old_start = other.old_start;
200
201 if other_old_start > self_old_end {
202 other_old_start - self_old_end <= gap
203 } else {
204 // Overlapping or adjacent
205 true
206 }
207 }
208
209 /// Combine this change with another, producing a merged change.
210 ///

Callers 1

add_pendingMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected