Function difft::diff::lcs_diff::slice_unique_by_hash
source · pub(crate) fn slice_unique_by_hash<'a, T: Eq + Clone + Hash>(
lhs: &'a [T],
rhs: &'a [T]
) -> Vec<DiffResult<&'a T>>Expand description
Compute the linear diff between lhs and rhs. If there are
items that only occur on a single side, mark them as novel without
processing them with Myer’s diff.
This is substantially faster than slice, when lhs and rhs
have few items in common.
(This heuristic is used in traditional diff tools too, such as GNU diff.)