Function difft::display::hunks::novel_section_in_order
source · fn novel_section_in_order(
lhs_novel_mps: &[&MatchedPos],
rhs_novel_mps: &[&MatchedPos],
lhs_prev_matched_line: Option<LineNumber>,
rhs_prev_matched_line: Option<LineNumber>,
opposite_to_lhs: &HashMap<LineNumber, HashSet<LineNumber>, BuildHasherDefault<FxHasher>>,
opposite_to_rhs: &HashMap<LineNumber, HashSet<LineNumber>, BuildHasherDefault<FxHasher>>
) -> Vec<(Side, MatchedPos)>
Expand description
Given a sequence of novel MatchedPos
values in a section between
two unchanged MatchedPos
values, return them in an order suited
for displaying.
unchanged-before novel-1
novel-2
novel-3
novel-4 unchanged-after
We need novel-1 to occur before novel-2/3, and novel-2/3 to occur before novel-4, so we can safely interleave LHS and RHS whilst still being monotonically increasing.