DiffUtility.FindDifferences<T> method (1 of 2)

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.

Return Value

A sequence of pairs that indicate the differences between the lists.

Remarks

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.

See Also


DiffUtility.FindDifferences<T> method (2 of 2)

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.

Return Value

A sequence of pairs that indicate the differences between the lists.

Remarks

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.

See Also