Skip to content

Commit b24de8f

Browse files
authored
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.
2 parents 5e6eeb0 + 74ea108 commit b24de8f

File tree

1 file changed

+2
-6
lines changed
  • src/librustc/infer/lexical_region_resolve

1 file changed

+2
-6
lines changed

src/librustc/infer/lexical_region_resolve/mod.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
204204
// want to stop at the first constraint that makes a change.
205205
let mut any_changed = false;
206206
for member_constraint in &self.data.member_constraints {
207-
if self.enforce_member_constraint(graph, member_constraint, var_values) {
208-
any_changed = true;
209-
}
207+
any_changed |= self.enforce_member_constraint(graph, member_constraint, var_values);
210208
}
211209
any_changed
212210
}
@@ -337,9 +335,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
337335
for index in live_indices.iter() {
338336
let constraint = constraints[index];
339337
let (edge_changed, retain) = process_constraint(constraint);
340-
if edge_changed {
341-
changed = true;
342-
}
338+
changed |= edge_changed;
343339
if !retain {
344340
let changed = killed_indices.insert(index);
345341
debug_assert!(changed);

0 commit comments

Comments
 (0)