mirror of
https://github.com/roc-lang/roc.git
synced 2024-11-13 09:49:11 +03:00
style
This commit is contained in:
parent
9a1e3466c9
commit
4fb205a4ba
22
vendor/ena/src/unify/mod.rs
vendored
22
vendor/ena/src/unify/mod.rs
vendored
@ -303,20 +303,18 @@ impl<S: UnificationStore> UnificationTable<S> {
|
|||||||
/// callsites. `uninlined_get_root_key` is the never-inlined version.
|
/// callsites. `uninlined_get_root_key` is the never-inlined version.
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
pub fn inlined_get_root_key(&mut self, vid: S::Key) -> S::Key {
|
pub fn inlined_get_root_key(&mut self, vid: S::Key) -> S::Key {
|
||||||
let redirect = {
|
match self.value(vid).parent(vid) {
|
||||||
match self.value(vid).parent(vid) {
|
None => vid,
|
||||||
None => return vid,
|
Some(redirect) => {
|
||||||
Some(redirect) => redirect,
|
let root_key: S::Key = self.uninlined_get_root_key(redirect);
|
||||||
|
if root_key != redirect {
|
||||||
|
// Path compression
|
||||||
|
self.update_value(vid, |value| value.parent = root_key);
|
||||||
|
}
|
||||||
|
|
||||||
|
root_key
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
let root_key: S::Key = self.uninlined_get_root_key(redirect);
|
|
||||||
if root_key != redirect {
|
|
||||||
// Path compression
|
|
||||||
self.update_value(vid, |value| value.parent = root_key);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
root_key
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is a never-inlined version of this function for cold callsites.
|
// This is a never-inlined version of this function for cold callsites.
|
||||||
|
Loading…
Reference in New Issue
Block a user