|
9 | 9 | namespace Microsoft.Data.DataView
|
10 | 10 | {
|
11 | 11 | /// <summary>
|
12 |
| - /// A structure serving as a sixteen-byte unsigned integer. It is used as the row id of <see cref="IDataView"/>. |
| 12 | + /// A structure serving as the identifier of a row of <see cref="IDataView"/>. |
13 | 13 | /// For datasets with millions of records, those IDs need to be unique, therefore the need for such a large structure to hold the values.
|
14 | 14 | /// Those Ids are derived from other Ids of the previous components of the pipelines, and dividing the structure in two: high order and low order of bits,
|
15 | 15 | /// and reduces the changes of those collisions even further.
|
@@ -53,70 +53,13 @@ public bool Equals(DataViewRowId other)
|
53 | 53 |
|
54 | 54 | public override bool Equals(object obj)
|
55 | 55 | {
|
56 |
| - if (obj != null && obj is DataViewRowId) |
| 56 | + if (obj is DataViewRowId other) |
57 | 57 | {
|
58 |
| - var item = (DataViewRowId)obj; |
59 |
| - return Equals(item); |
| 58 | + return Equals(other); |
60 | 59 | }
|
61 | 60 | return false;
|
62 | 61 | }
|
63 | 62 |
|
64 |
| - public static DataViewRowId operator +(DataViewRowId first, ulong second) |
65 |
| - { |
66 |
| - ulong resHi = first.High; |
67 |
| - ulong resLo = first.Low + second; |
68 |
| - if (resLo < second) |
69 |
| - resHi++; |
70 |
| - return new DataViewRowId(resLo, resHi); |
71 |
| - } |
72 |
| - |
73 |
| - public static DataViewRowId operator -(DataViewRowId first, ulong second) |
74 |
| - { |
75 |
| - ulong resHi = first.High; |
76 |
| - ulong resLo = first.Low - second; |
77 |
| - if (resLo > first.Low) |
78 |
| - resHi--; |
79 |
| - return new DataViewRowId(resLo, resHi); |
80 |
| - } |
81 |
| - |
82 |
| - public static bool operator ==(DataViewRowId first, ulong second) |
83 |
| - { |
84 |
| - return first.High == 0 && first.Low == second; |
85 |
| - } |
86 |
| - |
87 |
| - public static bool operator !=(DataViewRowId first, ulong second) |
88 |
| - { |
89 |
| - return !(first == second); |
90 |
| - } |
91 |
| - |
92 |
| - public static bool operator <(DataViewRowId first, ulong second) |
93 |
| - { |
94 |
| - return first.High == 0 && first.Low < second; |
95 |
| - } |
96 |
| - |
97 |
| - public static bool operator >(DataViewRowId first, ulong second) |
98 |
| - { |
99 |
| - return first.High > 0 || first.Low > second; |
100 |
| - } |
101 |
| - |
102 |
| - public static bool operator <=(DataViewRowId first, ulong second) |
103 |
| - { |
104 |
| - return first.High == 0 && first.Low <= second; |
105 |
| - } |
106 |
| - |
107 |
| - public static bool operator >=(DataViewRowId first, ulong second) |
108 |
| - { |
109 |
| - return first.High > 0 || first.Low >= second; |
110 |
| - } |
111 |
| - |
112 |
| - public static explicit operator double(DataViewRowId x) |
113 |
| - { |
114 |
| - // REVIEW: The 64-bit JIT has a bug where rounding might be not quite |
115 |
| - // correct when converting a ulong to double with the high bit set. Should we |
116 |
| - // care and compensate? See the DoubleParser code for a work-around. |
117 |
| - return x.High * ((double)(1UL << 32) * (1UL << 32)) + x.Low; |
118 |
| - } |
119 |
| - |
120 | 63 | public override int GetHashCode()
|
121 | 64 | {
|
122 | 65 | return (int)(
|
|
0 commit comments