diff options
author | Ben Adams <thundercat@illyriad.co.uk> | 2018-03-29 00:11:38 +0100 |
---|---|---|
committer | Stephen Toub <stoub@microsoft.com> | 2018-03-28 16:11:38 -0700 |
commit | fe867dd0a03116886e55da6b2964046cd9fae826 (patch) | |
tree | cf9802ddcd076dfc96fd1f2de125b51ca5c3ef9f /src/mscorlib/shared | |
parent | 41c0e4f260e238f232acc7895e7e628947cfe131 (diff) | |
download | coreclr-fe867dd0a03116886e55da6b2964046cd9fae826.tar.gz coreclr-fe867dd0a03116886e55da6b2964046cd9fae826.tar.bz2 coreclr-fe867dd0a03116886e55da6b2964046cd9fae826.zip |
Fix Dictionary CopyTo regression (#17300)
Diffstat (limited to 'src/mscorlib/shared')
-rw-r--r-- | src/mscorlib/shared/System/Collections/Generic/Dictionary.cs | 14 | ||||
-rw-r--r-- | src/mscorlib/shared/System/Collections/Generic/List.cs | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/mscorlib/shared/System/Collections/Generic/Dictionary.cs b/src/mscorlib/shared/System/Collections/Generic/Dictionary.cs index 827cc24ac2..f0e892859e 100644 --- a/src/mscorlib/shared/System/Collections/Generic/Dictionary.cs +++ b/src/mscorlib/shared/System/Collections/Generic/Dictionary.cs @@ -315,7 +315,7 @@ namespace System.Collections.Generic { if (entries[i].hashCode >= 0) { - array[index + i] = new KeyValuePair<TKey, TValue>(entries[i].key, entries[i].value); + array[index++] = new KeyValuePair<TKey, TValue>(entries[i].key, entries[i].value); } } } @@ -822,7 +822,7 @@ namespace System.Collections.Generic { if (entries[i].hashCode >= 0) { - dictEntryArray[index + i] = new DictionaryEntry(entries[i].key, entries[i].value); + dictEntryArray[index++] = new DictionaryEntry(entries[i].key, entries[i].value); } } } @@ -842,7 +842,7 @@ namespace System.Collections.Generic { if (entries[i].hashCode >= 0) { - objects[index + i] = new KeyValuePair<TKey, TValue>(entries[i].key, entries[i].value); + objects[index++] = new KeyValuePair<TKey, TValue>(entries[i].key, entries[i].value); } } } @@ -1210,7 +1210,7 @@ namespace System.Collections.Generic Entry[] entries = _dictionary._entries; for (int i = 0; i < count; i++) { - if (entries[i].hashCode >= 0) array[index + i] = entries[i].key; + if (entries[i].hashCode >= 0) array[index++] = entries[i].key; } } @@ -1270,7 +1270,7 @@ namespace System.Collections.Generic { for (int i = 0; i < count; i++) { - if (entries[i].hashCode >= 0) objects[index + i] = entries[i].key; + if (entries[i].hashCode >= 0) objects[index++] = entries[i].key; } } catch (ArrayTypeMismatchException) @@ -1393,7 +1393,7 @@ namespace System.Collections.Generic Entry[] entries = _dictionary._entries; for (int i = 0; i < count; i++) { - if (entries[i].hashCode >= 0) array[index + i] = entries[i].value; + if (entries[i].hashCode >= 0) array[index++] = entries[i].value; } } @@ -1453,7 +1453,7 @@ namespace System.Collections.Generic { for (int i = 0; i < count; i++) { - if (entries[i].hashCode >= 0) objects[index + i] = entries[i].value; + if (entries[i].hashCode >= 0) objects[index++] = entries[i].value; } } catch (ArrayTypeMismatchException) diff --git a/src/mscorlib/shared/System/Collections/Generic/List.cs b/src/mscorlib/shared/System/Collections/Generic/List.cs index a5cbf12a65..6b9f9b45b3 100644 --- a/src/mscorlib/shared/System/Collections/Generic/List.cs +++ b/src/mscorlib/shared/System/Collections/Generic/List.cs @@ -163,12 +163,12 @@ namespace System.Collections.Generic set { - _version++; if ((uint)index >= (uint)_size) { ThrowHelper.ThrowArgumentOutOfRange_IndexException(); } _items[index] = value; + _version++; } } |