Rollup merge of #85436 - tamird:save-clone, r=estebank

Avoid cloning cache key

r? `@estebank`
This commit is contained in:
Yuki Okushi 2021-06-06 19:11:16 +09:00 committed by GitHub
commit b3bcf4af74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -342,7 +342,7 @@ fn register_obligation_at(&mut self, obligation: O, parent: Option<usize>) -> Re
return Ok(());
}
match self.active_cache.entry(cache_key.clone()) {
match self.active_cache.entry(cache_key) {
Entry::Occupied(o) => {
let node = &mut self.nodes[*o.get()];
if let Some(parent_index) = parent {
@ -366,8 +366,7 @@ fn register_obligation_at(&mut self, obligation: O, parent: Option<usize>) -> Re
&& self
.error_cache
.get(&obligation_tree_id)
.map(|errors| errors.contains(&cache_key))
.unwrap_or(false);
.map_or(false, |errors| errors.contains(v.key()));
if already_failed {
Err(())