summaryrefslogtreecommitdiffstats
path: root/vendor/ena/src/unify/mod.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:50 +0000
commit2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35 (patch)
treed325add32978dbdc1db975a438b3a77d571b1ab8 /vendor/ena/src/unify/mod.rs
parentReleasing progress-linux version 1.68.2+dfsg1-1~progress7.99u1. (diff)
downloadrustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.tar.xz
rustc-2e00214b3efbdfeefaa0fe9e8b8fd519de7adc35.zip
Merging upstream version 1.69.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/ena/src/unify/mod.rs')
-rw-r--r--vendor/ena/src/unify/mod.rs24
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