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

◆ CopyTo() [2/2]

void System.Collections.Generic.LinkedList< T >.CopyTo ( T[] array,
int index )
inline

Implements System.Collections.Generic.ICollection< T >.

Definition at line 268 of file LinkedList.cs.

269 {
270 if (array == null)
271 {
272 throw new ArgumentNullException("array");
273 }
274 if (index < 0)
275 {
276 throw new ArgumentOutOfRangeException("index", index, System.SR.ArgumentOutOfRange_NeedNonNegNum);
277 }
278 if (index > array.Length)
279 {
280 throw new ArgumentOutOfRangeException("index", index, System.SR.ArgumentOutOfRange_BiggerThanCollection);
281 }
282 if (array.Length - index < Count)
283 {
285 }
286 LinkedListNode<T> next = head;
287 if (next != null)
288 {
289 do
290 {
291 array[index++] = next.item;
292 next = next.next;
293 }
294 while (next != head);
295 }
296 }
static string ArgumentOutOfRange_BiggerThanCollection
Definition SR.cs:56
static string Arg_InsufficientSpace
Definition SR.cs:26
static string ArgumentOutOfRange_NeedNonNegNum
Definition SR.cs:32
Definition SR.cs:7

References System.SR.Arg_InsufficientSpace, System.SR.ArgumentOutOfRange_BiggerThanCollection, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.array, System.Collections.Generic.LinkedList< T >.Count, System.Collections.Generic.LinkedList< T >.head, and System.index.

Referenced by System.Collections.Generic.LinkedList< T >.CopyTo(), and System.Collections.Generic.LinkedList< T >.GetObjectData().