Rollup merge of #99110 - audunhalland:match_has_guard_from_candidate, r=pnkfelix
Determine match_has_guard from candidates instead of looking up thir table again Currently looking through mir build of matches because of interest in deref patterns. Finding some micro-optimizable things.
This commit is contained in:
commit
561ea0a746
1 changed files with 1 additions and 1 deletions
|
@ -170,7 +170,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||||
|
|
||||||
let mut arm_candidates = self.create_match_candidates(scrutinee_place.clone(), &arms);
|
let mut arm_candidates = self.create_match_candidates(scrutinee_place.clone(), &arms);
|
||||||
|
|
||||||
let match_has_guard = arms.iter().copied().any(|arm| self.thir[arm].guard.is_some());
|
let match_has_guard = arm_candidates.iter().any(|(_, candidate)| candidate.has_guard);
|
||||||
let mut candidates =
|
let mut candidates =
|
||||||
arm_candidates.iter_mut().map(|(_, candidate)| candidate).collect::<Vec<_>>();
|
arm_candidates.iter_mut().map(|(_, candidate)| candidate).collect::<Vec<_>>();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue