From 6fdd5a138e084286d9607599587c9a6df00e6979 Mon Sep 17 00:00:00 2001 From: Chris Cameron Date: Tue, 12 Jun 2018 14:52:13 -0400 Subject: [PATCH] feat: Adding SequenceEqual shim --- .../Extensions/EnumerableExtensions.cs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ICD.Common.Utils/Extensions/EnumerableExtensions.cs b/ICD.Common.Utils/Extensions/EnumerableExtensions.cs index d8cd021..41a14b9 100644 --- a/ICD.Common.Utils/Extensions/EnumerableExtensions.cs +++ b/ICD.Common.Utils/Extensions/EnumerableExtensions.cs @@ -186,6 +186,28 @@ namespace ICD.Common.Utils.Extensions return extends.TryElementAt(index, out output) ? output : defaultValue; } + /// + /// Compares the two sequences for identical values. + /// + /// + /// + /// + /// + /// + public static bool SequenceEqual(this IEnumerable extends, IEnumerable other, IEqualityComparer 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); + } + /// /// Compares the two sequences for identical values. ///