Skip to content

Commit

Permalink
Rollup merge of #68026 - llogiq:ch-ch-ch-ch-changes, r=varkor
Browse files Browse the repository at this point in the history
Small improvements in lexical_region_resolve

This just replaces a trivial `if` condition with a `|=` in two places.

I could even have used a `fold` in the first case, but I think it would be less readable.
  • Loading branch information
Centril authored Jan 8, 2020
2 parents 5e6eeb0 + 74ea108 commit b24de8f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/librustc/infer/lexical_region_resolve/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
// want to stop at the first constraint that makes a change.
let mut any_changed = false;
for member_constraint in &self.data.member_constraints {
if self.enforce_member_constraint(graph, member_constraint, var_values) {
any_changed = true;
}
any_changed |= self.enforce_member_constraint(graph, member_constraint, var_values);
}
any_changed
}
Expand Down Expand Up @@ -337,9 +335,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
for index in live_indices.iter() {
let constraint = constraints[index];
let (edge_changed, retain) = process_constraint(constraint);
if edge_changed {
changed = true;
}
changed |= edge_changed;
if !retain {
let changed = killed_indices.insert(index);
debug_assert!(changed);
Expand Down

0 comments on commit b24de8f

Please sign in to comment.