Function difft::display::hunks::merge_adjacent
source · pub(crate) fn merge_adjacent(
hunks: &[Hunk],
opposite_to_lhs: &HashMap<LineNumber, FxHashSet<LineNumber>, BuildHasherDefault<FxHasher>>,
opposite_to_rhs: &HashMap<LineNumber, FxHashSet<LineNumber>, BuildHasherDefault<FxHasher>>,
max_lhs_src_line: LineNumber,
max_rhs_src_line: LineNumber,
num_context_lines: usize
) -> Vec<Hunk>Expand description
If any hunks are sufficiently close that they have overlapping lines, merge them.
For example, given a hunk from lines 8-10 and a hunk from lines 12-15 with 5 context lines, combine the two hunks.