mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 03:57:32 +00:00
feat: Adding SequenceEqual shim
This commit is contained in:
parent
fb267465ce
commit
6fdd5a138e
1 changed files with 22 additions and 0 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue