Author: jbevain
Date: 2008-01-22 03:51:44 -0500 (Tue, 22 Jan 2008)
New Revision: 93483
Modified:
trunk/mcs/class/System.Core/System.Linq/Enumerable.cs
Log:
fix ToDictionary comparer
Modified: trunk/mcs/class/System.Core/System.Linq/Enumerable.cs
===================================================================
--- trunk/mcs/class/System.Core/System.Linq/Enumerable.cs 2008-01-22
08:44:22 UTC (rev 93482)
+++ trunk/mcs/class/System.Core/System.Linq/Enumerable.cs 2008-01-22
08:51:44 UTC (rev 93483)
@@ -2189,6 +2189,9 @@
{
Check.SourceAndKeyElementSelectors (source,
keySelector, elementSelector);
+ if (comparer == null)
+ comparer = EqualityComparer<TKey>.Default;
+
var dict = new Dictionary<TKey, TElement> (comparer);
foreach (var e in source)
dict.Add (keySelector (e), elementSelector (e));
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches