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

◆ CopyTo() [2/2]

void System.Data.RBTree< K >.CopyTo ( K[] array,
int index )
inline

Definition at line 1303 of file RBTree.cs.

1304 {
1305 if (array == null)
1306 {
1307 throw ExceptionBuilder.ArgumentNull("array");
1308 }
1309 if (index < 0)
1310 {
1311 throw ExceptionBuilder.ArgumentOutOfRange("index");
1312 }
1313 int count = Count;
1314 if (array.Length - index < Count)
1315 {
1316 throw ExceptionBuilder.InvalidOffsetLength();
1317 }
1318 int num = Minimum(root);
1319 for (int i = 0; i < count; i++)
1320 {
1321 array[index + i] = Key(num);
1322 num = Successor(num);
1323 }
1324 }
K Key(int nodeId)
Definition RBTree.cs:1407
int Successor(int x_id)
Definition RBTree.cs:400
int Minimum(int x_id)
Definition RBTree.cs:447

References System.Data.ExceptionBuilder.ArgumentNull(), System.Data.ExceptionBuilder.ArgumentOutOfRange(), System.array, System.Data.RBTree< K >.Count, System.count, System.index, System.Data.ExceptionBuilder.InvalidOffsetLength(), System.Data.RBTree< K >.Key(), System.Data.RBTree< K >.Minimum(), System.Data.RBTree< K >.root, and System.Data.RBTree< K >.Successor().