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

◆ CopyTo() [3/3]

void System.Collections.Generic.HashSet< T >.CopyTo ( T[] array,
int arrayIndex,
int count )
inline

Definition at line 725 of file HashSet.cs.

726 {
727 if (array == null)
728 {
729 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.array);
730 }
731 if (arrayIndex < 0)
732 {
733 throw new ArgumentOutOfRangeException("arrayIndex", arrayIndex, SR.ArgumentOutOfRange_NeedNonNegNum);
734 }
735 if (count < 0)
736 {
737 throw new ArgumentOutOfRangeException("count", count, SR.ArgumentOutOfRange_NeedNonNegNum);
738 }
739 if (arrayIndex > array.Length || count > array.Length - arrayIndex)
740 {
741 ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_ArrayPlusOffTooSmall);
742 }
744 for (int i = 0; i < _count; i++)
745 {
746 if (count == 0)
747 {
748 break;
749 }
751 if (reference.Next >= -1)
752 {
753 array[arrayIndex++] = reference.Value;
754 count--;
755 }
756 }
757 }

References System.Collections.Generic.HashSet< T >._count, System.Collections.Generic.HashSet< T >._entries, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.array, System.arrayIndex, System.count, System.ThrowHelper.ThrowArgumentException(), and System.ThrowHelper.ThrowArgumentNullException().