diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:41 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:41 +0000 |
commit | 4f9fe856a25ab29345b90e7725509e9ee38a37be (patch) | |
tree | e4ffd8a9374cae7b21f7cbfb352927e0e074aff6 /vendor/ena/src/unify/mod.rs | |
parent | Adding upstream version 1.68.2+dfsg1. (diff) | |
download | rustc-5cd5bd4daf55da04d2c8e7c06c3067a027cfbfc2.tar.xz rustc-5cd5bd4daf55da04d2c8e7c06c3067a027cfbfc2.zip |
Adding upstream version 1.69.0+dfsg1.upstream/1.69.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | vendor/ena/src/unify/mod.rs | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/vendor/ena/src/unify/mod.rs b/vendor/ena/src/unify/mod.rs index a26d699d8..5377177be 100644 --- a/vendor/ena/src/unify/mod.rs +++ b/vendor/ena/src/unify/mod.rs @@ -230,19 +230,8 @@ impl<K: UnifyKey> VarValue<K> { self.rank = rank; self.value = value; } - - fn parent(&self, self_key: K) -> Option<K> { - self.if_not_self(self.parent, self_key) - } - - fn if_not_self(&self, key: K, self_key: K) -> Option<K> { - if key == self_key { - None - } else { - Some(key) - } - } } + impl<K> UnificationTableStorage<K> where K: UnifyKey, @@ -358,13 +347,12 @@ impl<S: UnificationStoreMut> UnificationTable<S> { /// callsites. `uninlined_get_root_key` is the never-inlined version. #[inline(always)] fn inlined_get_root_key(&mut self, vid: S::Key) -> S::Key { - let redirect = { - match self.value(vid).parent(vid) { - None => return vid, - Some(redirect) => redirect, - } - }; + let v = self.value(vid); + if v.parent == vid { + return vid; + } + let redirect = v.parent; let root_key: S::Key = self.uninlined_get_root_key(redirect); if root_key != redirect { // Path compression |