Skip to content

Commit

Permalink
Rollup merge of #85436 - tamird:save-clone, r=estebank
Browse files Browse the repository at this point in the history
Avoid cloning cache key

r? `@estebank`
  • Loading branch information
JohnTitor authored Jun 6, 2021
2 parents 9a57617 + 42b9d3f commit b3bcf4a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions compiler/rustc_data_structures/src/obligation_forest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ impl<O: ForestObligation> ObligationForest<O> {
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 {
Expand All @@ -366,8 +366,7 @@ impl<O: ForestObligation> ObligationForest<O> {
&& 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(())
Expand Down

0 comments on commit b3bcf4a

Please sign in to comment.