mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-02-16 21:24:58 +00:00
feat: Adding SequenceEqual shim
This commit is contained in:
@@ -186,6 +186,28 @@ namespace ICD.Common.Utils.Extensions
|
|||||||
return extends.TryElementAt(index, out output) ? output : defaultValue;
|
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>
|
/// <summary>
|
||||||
/// Compares the two sequences for identical values.
|
/// Compares the two sequences for identical values.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user