diff --git a/ICD.Common.Utils/Extensions/EnumerableExtensions.cs b/ICD.Common.Utils/Extensions/EnumerableExtensions.cs index 1d1269b..edac918 100644 --- a/ICD.Common.Utils/Extensions/EnumerableExtensions.cs +++ b/ICD.Common.Utils/Extensions/EnumerableExtensions.cs @@ -227,6 +227,12 @@ namespace ICD.Common.Utils.Extensions if (comparer == null) throw new ArgumentNullException("comparer"); + // Simple count check + ICollection a = extends as ICollection; + ICollection b = other as ICollection; + if (a != null && b != null && a.Count != b.Count) + return false; + using (IEnumerator firstPos = extends.GetEnumerator()) { using (IEnumerator secondPos = other.GetEnumerator()) @@ -285,6 +291,12 @@ namespace ICD.Common.Utils.Extensions if (comparer == null) throw new ArgumentNullException("comparer"); + // Simple count check + ICollection a = extends as ICollection; + ICollection b = other as ICollection; + if (a != null && b != null && a.Count != b.Count) + return false; + Dictionary count = new Dictionary(comparer); foreach (T item in extends)