Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ BinarySearch< T >() [2/4]

static int System.Array.BinarySearch< T > ( T[] array,
int index,
int length,
T value,
IComparer< T >? comparer )
inlinestatic

Definition at line 1516 of file Array.cs.

1517 {
1518 if (array == null)
1519 {
1520 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.array);
1521 }
1522 if (index < 0)
1523 {
1524 ThrowHelper.ThrowIndexArgumentOutOfRange_NeedNonNegNumException();
1525 }
1526 if (length < 0)
1527 {
1528 ThrowHelper.ThrowLengthArgumentOutOfRange_ArgumentOutOfRange_NeedNonNegNum();
1529 }
1530 if (array.Length - index < length)
1531 {
1532 ThrowHelper.ThrowArgumentException(ExceptionResource.Argument_InvalidOffLen);
1533 }
1534 return ArraySortHelper<T>.Default.BinarySearch(array, index, length, value, comparer);
1535 }

References System.array, System.comparer, System.index, System.length, System.ThrowHelper.ThrowArgumentException(), System.ThrowHelper.ThrowArgumentNullException(), System.ThrowHelper.ThrowIndexArgumentOutOfRange_NeedNonNegNumException(), System.ThrowHelper.ThrowLengthArgumentOutOfRange_ArgumentOutOfRange_NeedNonNegNum(), and System.value.