Skip to content

Commit

Permalink
Rollup merge of rust-lang#53551 - nnethercote:access_place_error_repo…
Browse files Browse the repository at this point in the history
…rted, r=varkor

Avoid some Place clones.

This is a 0.5% speedup on ripgrep.
  • Loading branch information
kennytm committed Aug 21, 2018
2 parents 0dd88c9 + c0636ab commit e3887e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/librustc_mir/borrow_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,10 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
}
}

if self
// Check is_empty() first because it's the common case, and doing that
// way we avoid the clone() call.
if !self.access_place_error_reported.is_empty() &&
self
.access_place_error_reported
.contains(&(place_span.0.clone(), place_span.1))
{
Expand Down

0 comments on commit e3887e6

Please sign in to comment.