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

◆ SequenceCompareTo< T >()

static int System.SpanHelpers.SequenceCompareTo< T > ( ref T first,
int firstLength,
ref T second,
int secondLength )
inlinestatic
Type Constraints
T :IComparable<T> 

Definition at line 3921 of file SpanHelpers.cs.

3922 {
3923 int num = firstLength;
3924 if (num > secondLength)
3925 {
3926 num = secondLength;
3927 }
3928 for (int i = 0; i < num; i++)
3929 {
3930 T val = Unsafe.Add(ref second, i);
3931 int num2 = Unsafe.Add(ref first, i)?.CompareTo(val) ?? ((val != null) ? (-1) : 0);
3932 if (num2 != 0)
3933 {
3934 return num2;
3935 }
3936 }
3937 return firstLength.CompareTo(secondLength);
3938 }