Sorry about the white space. Like I said, it basically fixes the issue for our 
project, but I doubt it is the ideal way to fix the issue. Since the Dictionary 
will need to be removed from the function perhaps a re-write is in order.

I've again attached the patch, and I release it under the MIT/X11 License.

Thanks,

Richard Kiene
Index: System.Linq/Enumerable.cs
===================================================================
--- System.Linq/Enumerable.cs   (revision 147679)
+++ System.Linq/Enumerable.cs   (working copy)
@@ -756,6 +756,11 @@
                                yield return grouping;
                                counter++;
                        }
+
+                       if (counter == nullCounter) {
+                               Grouping<TKey, TElement> nullGroup = new 
Grouping<TKey, TElement> (default (TKey), nullList);
+                               yield return nullGroup;
+                       }
                }
 
                public static IEnumerable<TResult> GroupBy<TSource, TKey, 
TElement, TResult> (this IEnumerable<TSource> source,

On Apr 29, 2010, at 2:32 PM, Alan McGovern wrote:

Hey

More than 50% of your patch is whitespace noise which makes it hard to see what exactly it is you're fixing. Could you submit a patch without all the extra whitespace changes?

Secondly, I'd personally view any code which relies on the element ordering in a dictionary as being a bug and should be fixed.

As for the actual patch, I have no comments ;)

Alan

On 29 Apr 2010, at 22:18, Richard Kiene <richard.ki...@logos.com> wrote:

I have filed Bug 601101 https://bugzilla.novell.com/show_bug.cgi?id=601101 for this issue. In addition; I have attached a patch which resolves the issue. That said, I'm not really sure this patch is the most desirable way to fix the bug. If you would like to use the patch I release it under the MIT/X11 License.

Also worth noting is that a Dictionary is used to create the groups, but Dictionary as defined by MSDN does not preserve element ordering. It appears that the mono implementation of Dictionary does and that is why it is used, is this correct?

Thanks,

Richard Kiene
<GroupBy.patch.txt>
<ATT00001..htm>
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to