@@ -169,7 +169,7 @@ where
169169 unsafe { self .__check_if_can_insert (found ) };
170170
171171 let lhs_index = found_index ;
172- let rhs_index = self .linked_keys [found_index ];
172+ let rhs_index = self .linked_keys [found_index as u32 ];
173173
174174 assert (found * found == found );
175175
@@ -181,8 +181,8 @@ where
181181 // case 2 can be modified to `self.keys[found_index] + 1 <= idx <= self.keys[found_index + 1] - 1
182182 // combine the two into the following single statement:
183183 // `self.keys[found_index] + 1 - found <= idx <= self.keys[found_index + 1 - found] - 1 + found
184- let lhs = self .keys [lhs_index ];
185- let rhs = self .keys [rhs_index ];
184+ let lhs = self .keys [lhs_index as u32 ];
185+ let rhs = self .keys [rhs_index as u32 ];
186186 let lhs_condition = idx - lhs - 1 + found ;
187187 let rhs_condition = rhs - 1 + found - idx ;
188188 ComparisonFuncs ::assert_greater_than_or_equal (lhs_condition , 0 );
@@ -193,15 +193,15 @@ where
193193 // lhs points to tail_ptr
194194 // tail_ptr points to rhs
195195 if (found == 0 ) {
196- self .keys [self .tail_ptr ] = idx ;
196+ self .keys [self .tail_ptr as u32 ] = idx ;
197197
198- self .linked_keys [found_index ] = self .tail_ptr * (1 - found ) + found * rhs_index ;
198+ self .linked_keys [found_index as u32 ] = self .tail_ptr * (1 - found ) + found * rhs_index ;
199199
200- self .linked_keys [self .tail_ptr ] = rhs_index * (1 - found );
201- self .values [self .tail_ptr + 1 ] = value ;
200+ self .linked_keys [self .tail_ptr as u32 ] = rhs_index * (1 - found );
201+ self .values [( self .tail_ptr + 1 ) as u32 ] = value ;
202202 self .tail_ptr += 1 ;
203203 } else {
204- self .values [found_index + 1 ] = value ;
204+ self .values [( found_index + 1 ) as u32 ] = value ;
205205 }
206206 }
207207
@@ -211,7 +211,7 @@ where
211211 assert (found * found == found );
212212
213213 let lhs_index = found_index ;
214- let rhs_index = self .linked_keys [found_index ];
214+ let rhs_index = self .linked_keys [found_index as u32 ];
215215
216216 assert (found * found == found );
217217
@@ -223,8 +223,8 @@ where
223223 // case 2 can be modified to `self.keys[found_index] + 1 <= idx <= self.keys[found_index + 1] - 1
224224 // combine the two into the following single statement:
225225 // `self.keys[found_index] + 1 - found <= idx <= self.keys[found_index + 1 - found] - 1 + found
226- let lhs = self .keys [lhs_index ];
227- let rhs = self .keys [rhs_index ];
226+ let lhs = self .keys [lhs_index as u32 ];
227+ let rhs = self .keys [rhs_index as u32 ];
228228 let lhs_condition = idx - lhs - 1 + found ;
229229 let rhs_condition = rhs - 1 + found - idx ;
230230 ComparisonFuncs ::assert_greater_than_or_equal (lhs_condition , 0 );
@@ -233,7 +233,7 @@ where
233233 // lhs_condition.assert_max_bit_size::<32>();
234234 // rhs_condition.assert_max_bit_size::<32>();
235235 let value_index = (lhs_index + 1 ) * found ;
236- self .values [value_index ]
236+ self .values [value_index as u32 ]
237237 }
238238}
239239
0 commit comments