diff --git a/src/mscorlib/shared/System/Collections/Generic/Dictionary.cs b/src/mscorlib/shared/System/Collections/Generic/Dictionary.cs index 827cc24ac247..f0e892859ed1 100644 --- a/src/mscorlib/shared/System/Collections/Generic/Dictionary.cs +++ b/src/mscorlib/shared/System/Collections/Generic/Dictionary.cs @@ -315,7 +315,7 @@ private void CopyTo(KeyValuePair[] array, int index) { if (entries[i].hashCode >= 0) { - array[index + i] = new KeyValuePair(entries[i].key, entries[i].value); + array[index++] = new KeyValuePair(entries[i].key, entries[i].value); } } } @@ -822,7 +822,7 @@ void ICollection.CopyTo(Array array, int index) { 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 @@ void ICollection.CopyTo(Array array, int index) { if (entries[i].hashCode >= 0) { - objects[index + i] = new KeyValuePair(entries[i].key, entries[i].value); + objects[index++] = new KeyValuePair(entries[i].key, entries[i].value); } } } @@ -1210,7 +1210,7 @@ public void CopyTo(TKey[] array, int index) 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 @@ void ICollection.CopyTo(Array array, int index) { 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 @@ public void CopyTo(TValue[] array, int index) 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 @@ void ICollection.CopyTo(Array array, int index) { 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 a5cbf12a658b..6b9f9b45b35c 100644 --- a/src/mscorlib/shared/System/Collections/Generic/List.cs +++ b/src/mscorlib/shared/System/Collections/Generic/List.cs @@ -163,12 +163,12 @@ public T this[int index] set { - _version++; if ((uint)index >= (uint)_size) { ThrowHelper.ThrowArgumentOutOfRange_IndexException(); } _items[index] = value; + _version++; } }