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

◆ CompareArray()

static bool System.Data.DataRowComparer< TRow >.CompareArray ( Array a,
Array b )
inlinestaticprivate

Definition at line 43 of file DataRowComparer.cs.

44 {
45 if (b == null || 1 != a.Rank || 1 != b.Rank || a.Length != b.Length)
46 {
47 return false;
48 }
49 int num = a.GetLowerBound(0);
50 int num2 = b.GetLowerBound(0);
51 if (a.GetType() == b.GetType() && num == 0 && num2 == 0)
52 {
53 switch (Type.GetTypeCode(a.GetType().GetElementType()))
54 {
55 case TypeCode.Byte:
56 return CompareEquatableArray((byte[])a, (byte[])b);
57 case TypeCode.Int16:
58 return CompareEquatableArray((short[])a, (short[])b);
59 case TypeCode.Int32:
60 return CompareEquatableArray((int[])a, (int[])b);
61 case TypeCode.Int64:
62 return CompareEquatableArray((long[])a, (long[])b);
63 case TypeCode.String:
64 return CompareEquatableArray((string[])a, (string[])b);
65 }
66 }
67 int num3 = num + a.Length;
68 while (num < num3)
69 {
70 if (!AreElementEqual(a.GetValue(num), b.GetValue(num2)))
71 {
72 return false;
73 }
74 num++;
75 num2++;
76 }
77 return true;
78 }
static bool AreElementEqual(object a, object b)

References System.Data.DataRowComparer< TRow >.AreElementEqual(), and System.Type.GetTypeCode().

Referenced by System.Data.DataRowComparer< TRow >.AreEqual().