feat: Adding SequenceEqual shim

This commit is contained in:
Chris Cameron
2018-06-12 14:52:13 -04:00
parent fb267465ce
commit 6fdd5a138e

View File

@@ -186,6 +186,28 @@ namespace ICD.Common.Utils.Extensions
return extends.TryElementAt(index, out output) ? output : defaultValue;
}
/// <summary>
/// Compares the two sequences for identical values.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="extends"></param>
/// <param name="other"></param>
/// <param name="comparer"></param>
/// <returns></returns>
public static bool SequenceEqual<T>(this IEnumerable<T> extends, IEnumerable<T> other, IEqualityComparer<T> comparer)
{
if (extends == null)
throw new ArgumentNullException("extends");
if (other == null)
throw new ArgumentNullException("other");
if (comparer == null)
throw new ArgumentNullException("comparer");
return extends.SequenceEqual(other, comparer.Equals);
}
/// <summary>
/// Compares the two sequences for identical values.
/// </summary>