diff options
author | Miguel de Icaza <miguel@gnome.org> | 2010-01-21 03:49:45 +0300 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2010-01-21 03:49:45 +0300 |
commit | 820ad1b0413a9f4adb2bba0dbb25a2d183c62072 (patch) | |
tree | 19a35f6ef85d284c15beccfa4d2cf062b1442be2 /mcs | |
parent | 3fb7f4ceeb49d4a078088b301751f16509179169 (diff) |
2010-01-20 Miguel de Icaza <miguel@novell.com>
* Dictionary.cs: Always create the keys, fixes compatibility
between Mono and .NET. Patch from John Lenz <jlenz2@math.uiuc.edu>
svn path=/trunk/mcs/; revision=149947
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/corlib/System.Collections.Generic/ChangeLog | 5 | ||||
-rw-r--r-- | mcs/class/corlib/System.Collections.Generic/Dictionary.cs | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/mcs/class/corlib/System.Collections.Generic/ChangeLog b/mcs/class/corlib/System.Collections.Generic/ChangeLog index eda8adf8774..6bce4cfb66d 100644 --- a/mcs/class/corlib/System.Collections.Generic/ChangeLog +++ b/mcs/class/corlib/System.Collections.Generic/ChangeLog @@ -1,3 +1,8 @@ +2010-01-20 Miguel de Icaza <miguel@novell.com> + + * Dictionary.cs: Always create the keys, fixes compatibility + between Mono and .NET. Patch from John Lenz <jlenz2@math.uiuc.edu> + 2009-12-06 Chris Toshok <toshok@ximian.com> * KeyValuePair.cs: we need setters for Key and Value so they can diff --git a/mcs/class/corlib/System.Collections.Generic/Dictionary.cs b/mcs/class/corlib/System.Collections.Generic/Dictionary.cs index f8fe6ccc274..91d3cc312bc 100644 --- a/mcs/class/corlib/System.Collections.Generic/Dictionary.cs +++ b/mcs/class/corlib/System.Collections.Generic/Dictionary.cs @@ -502,10 +502,9 @@ namespace System.Collections.Generic { info.AddValue ("Version", generation); info.AddValue ("Comparer", hcp); KeyValuePair<TKey, TValue> [] data = null; - if (count > 0) { - data = new KeyValuePair<TKey,TValue> [count]; + data = new KeyValuePair<TKey,TValue> [count]; + if (count > 0) CopyTo (data, 0); - } info.AddValue ("HashSize", table.Length); info.AddValue ("KeyValuePairs", data); } |