Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CopyTo() [4/4]

void System.Collections.Generic.Dictionary< TKey, TValue >.ValueCollection.CopyTo ( TValue[] array,
int index )
inline

Definition at line 543 of file Dictionary.cs.

544 {
545 if (array == null)
546 {
547 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.array);
548 }
549 if ((uint)index > array.Length)
550 {
551 ThrowHelper.ThrowIndexArgumentOutOfRange_NeedNonNegNumException();
552 }
553 if (array.Length - index < _dictionary.Count)
554 {
555 ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_ArrayPlusOffTooSmall);
556 }
557 int count = _dictionary._count;
558 Entry[] entries = _dictionary._entries;
559 for (int i = 0; i < count; i++)
560 {
561 if (entries[i].next >= -1)
562 {
563 array[index++] = entries[i].value;
564 }
565 }
566 }
readonly Dictionary< TKey, TValue > _dictionary

References System.Collections.Generic.Dictionary< TKey, TValue >.ValueCollection._dictionary, System.array, System.count, System.index, System.ThrowHelper.ThrowArgumentException(), System.ThrowHelper.ThrowArgumentNullException(), and System.ThrowHelper.ThrowIndexArgumentOutOfRange_NeedNonNegNumException().

Referenced by System.Collections.Generic.Dictionary< TKey, TValue >.ValueCollection.CopyTo(), and System.Xml.Serialization.XmlSerializerNamespaces.ToArray().