From 74ea108b47997db75147f8af9b74119ee341ecbd Mon Sep 17 00:00:00 2001 From: Andre Bogus Date: Wed, 8 Jan 2020 21:12:21 +0100 Subject: [PATCH] Small improvements in lexical_region_resolve --- src/librustc/infer/lexical_region_resolve/mod.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/librustc/infer/lexical_region_resolve/mod.rs b/src/librustc/infer/lexical_region_resolve/mod.rs index e78382c0a3234..0bc49a2901505 100644 --- a/src/librustc/infer/lexical_region_resolve/mod.rs +++ b/src/librustc/infer/lexical_region_resolve/mod.rs @@ -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);