Rollup merge of #68026 - llogiq:ch-ch-ch-ch-changes, r=varkor

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.
This commit is contained in:
Mazdak Farrokhzad 2020-01-09 00:22:21 +01:00 committed by GitHub
commit b24de8f0f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -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
}
@ -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);