Finds the differences between the two lists.
public static IReadOnlyList<ValueTuple<IndexRange, IndexRange>> FindDifferences<T>(IReadOnlyList<T> first, IReadOnlyList<T> second)
parameter | description |
---|---|
T | The type of item in the lists. |
first | The first list. |
second | The second list. |
A sequence of pairs that indicate the differences between the lists.
Each pair identifies a range of items in each list. The items before and after each range are the same in both lists; the items in each range are the difference. One of the two ranges can be empty, but the index of the range still indicates where the missing items are.
EqualityComparer<T>.Default is used to compare items.
Finds the differences between the two lists.
public static IReadOnlyList<ValueTuple<IndexRange, IndexRange>> FindDifferences<T>(IReadOnlyList<T> first,
IReadOnlyList<T> second, IEqualityComparer<T> comparer)
parameter | description |
---|---|
T | The type of item in the lists. |
first | The first list. |
second | The second list. |
comparer | The comparer. |
A sequence of pairs that indicate the differences between the lists.
Each pair identifies a range of items in each list. The items before and after each range are the same in both lists; the items in each range are the difference. One of the two ranges can be empty, but the index of the range still indicates where the missing items are.
If comparer is null, EqualityComparer<T>.Default is used.