Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJb Evain <jbevain@gmail.com>2008-05-09 00:16:53 +0400
committerJb Evain <jbevain@gmail.com>2008-05-09 00:16:53 +0400
commitbd827da137b86c0e9d3206c3d63d812fde0c193c (patch)
tree22542434a7d87e413cc3dc75690ebb459ac61df4 /mcs/class/System.Core/System.Linq/Enumerable.cs
parent6ea580d53fa71a0358caa97bb430044b24c06cde (diff)
fix Except with custom comparer
svn path=/trunk/mcs/; revision=102829
Diffstat (limited to 'mcs/class/System.Core/System.Linq/Enumerable.cs')
-rw-r--r--mcs/class/System.Core/System.Linq/Enumerable.cs7
1 files changed, 3 insertions, 4 deletions
diff --git a/mcs/class/System.Core/System.Linq/Enumerable.cs b/mcs/class/System.Core/System.Linq/Enumerable.cs
index ed54ec8c3c4..7e12277e456 100644
--- a/mcs/class/System.Core/System.Linq/Enumerable.cs
+++ b/mcs/class/System.Core/System.Linq/Enumerable.cs
@@ -671,9 +671,9 @@ namespace System.Linq
static IEnumerable<TSource> CreateExceptIterator<TSource> (IEnumerable<TSource> first, IEnumerable<TSource> second, IEqualityComparer<TSource> comparer)
{
- var items = new HashSet<TSource> (Distinct (second));
- foreach (TSource element in first) {
- if (! items.Contains (element, comparer))
+ var items = new HashSet<TSource> (second, comparer);
+ foreach (var element in first) {
+ if (!items.Contains (element, comparer))
yield return element;
}
}
@@ -747,7 +747,6 @@ namespace System.Linq
return null;
}
-
public static IEnumerable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey> (this IEnumerable<TSource> source,
Func<TSource, TKey> keySelector)
{