Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XmlStringSortKey.cs
Go to the documentation of this file.
2
4
5internal sealed class XmlStringSortKey : XmlSortKey
6{
7 private readonly SortKey _sortKey;
8
9 private readonly byte[] _sortKeyBytes;
10
11 private readonly bool _descendingOrder;
12
18
24
25 public override int CompareTo(object obj)
26 {
28 {
29 return CompareToEmpty(obj);
30 }
31 int num;
32 if (_sortKey != null)
33 {
35 }
36 else
37 {
38 int num2 = ((_sortKeyBytes.Length < xmlStringSortKey._sortKeyBytes.Length) ? _sortKeyBytes.Length : xmlStringSortKey._sortKeyBytes.Length);
39 int num3 = 0;
40 while (true)
41 {
42 if (num3 < num2)
43 {
44 if (_sortKeyBytes[num3] < xmlStringSortKey._sortKeyBytes[num3])
45 {
46 num = -1;
47 break;
48 }
49 if (_sortKeyBytes[num3] > xmlStringSortKey._sortKeyBytes[num3])
50 {
51 num = 1;
52 break;
53 }
54 num3++;
55 continue;
56 }
57 num = ((_sortKeyBytes.Length >= xmlStringSortKey._sortKeyBytes.Length) ? ((_sortKeyBytes.Length > xmlStringSortKey._sortKeyBytes.Length) ? 1 : 0) : (-1));
58 break;
59 }
60 }
61 if (num == 0)
62 {
64 }
66 {
67 return num;
68 }
69 return -num;
70 }
71}
static int Compare(SortKey sortkey1, SortKey sortkey2)
Definition SortKey.cs:27
int BreakSortingTie(XmlSortKey that)
Definition XmlSortKey.cs:33
XmlStringSortKey(SortKey sortKey, bool descendingOrder)
XmlStringSortKey(byte[] sortKey, bool descendingOrder)