Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/mscorlib/shared/System/Collections/Generic/Dictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ private void CopyTo(KeyValuePair<TKey, TValue>[] array, int index)
{
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);
}
}
}
Expand Down Expand Up @@ -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);
}
}
}
Expand All @@ -842,7 +842,7 @@ void ICollection.CopyTo(Array array, int index)
{
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);
}
}
}
Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
}

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/mscorlib/shared/System/Collections/Generic/List.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,12 @@ public T this[int index]

set
{
_version++;
if ((uint)index >= (uint)_size)
{
ThrowHelper.ThrowArgumentOutOfRange_IndexException();
}
_items[index] = value;
_version++;
}
}

Expand Down