Avoid needless re-entry to the interner

This commit is contained in:
Ayaz Hafiz 2023-01-04 13:54:45 -06:00
parent 68d6de79de
commit 6e0e11ea79
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

@ -1217,6 +1217,7 @@ impl std::fmt::Debug for LambdaSet<'_> {
f.debug_struct("LambdaSet")
.field("set", &Helper { set: self.set })
.field("representation", &self.representation)
.field("full_layout", &self.full_layout)
.finish()
}
}
@ -1767,7 +1768,7 @@ impl<'a> LambdaSet<'a> {
let Cacheable(result, criteria) = env.cached_or(closure_var, |env| {
let Cacheable(result, criteria) = Self::from_var_help(env, closure_var);
let result = result.map(Layout::LambdaSet).map(|l| env.cache.put_in(l));
let result = result.map(|l| l.full_layout);
Cacheable(result, criteria)
});
@ -3100,7 +3101,7 @@ fn layout_from_flat_type<'a>(
),
criteria
);
let lambda_set = env.cache.put_in(Layout::LambdaSet(lambda_set));
let lambda_set = lambda_set.full_layout;
Cacheable(Ok(lambda_set), criteria)
}