File tree 1 file changed +6
-18
lines changed
1 file changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -230,19 +230,8 @@ impl<K: UnifyKey> VarValue<K> {
230
230
self . rank = rank;
231
231
self . value = value;
232
232
}
233
-
234
- fn parent ( & self , self_key : K ) -> Option < K > {
235
- self . if_not_self ( self . parent , self_key)
236
- }
237
-
238
- fn if_not_self ( & self , key : K , self_key : K ) -> Option < K > {
239
- if key == self_key {
240
- None
241
- } else {
242
- Some ( key)
243
- }
244
- }
245
233
}
234
+
246
235
impl < K > UnificationTableStorage < K >
247
236
where
248
237
K : UnifyKey ,
@@ -358,13 +347,12 @@ impl<S: UnificationStoreMut> UnificationTable<S> {
358
347
/// callsites. `uninlined_get_root_key` is the never-inlined version.
359
348
#[ inline( always) ]
360
349
fn inlined_get_root_key ( & mut self , vid : S :: Key ) -> S :: Key {
361
- let redirect = {
362
- match self . value ( vid) . parent ( vid) {
363
- None => return vid,
364
- Some ( redirect) => redirect,
365
- }
366
- } ;
350
+ let v = self . value ( vid) ;
351
+ if v. parent == vid {
352
+ return vid;
353
+ }
367
354
355
+ let redirect = v. parent ;
368
356
let root_key: S :: Key = self . uninlined_get_root_key ( redirect) ;
369
357
if root_key != redirect {
370
358
// Path compression
You can’t perform that action at this time.
0 commit comments