]> git.lizzy.rs Git - rust.git/commitdiff
NLL performance boost
authorGergely Nagy <ngg@tresorit.com>
Wed, 6 Jun 2018 15:31:22 +0000 (17:31 +0200)
committerGergely Nagy <ngg@tresorit.com>
Wed, 6 Jun 2018 15:31:24 +0000 (17:31 +0200)
src/librustc_mir/borrow_check/nll/type_check/liveness.rs

index d19fd2bb5969dfc353142cfda186e5f93c19e8da..76320c6a2eacc96912c70f3ae3579ebb474bad0f 100644 (file)
@@ -104,13 +104,15 @@ fn add_liveness_constraints(&mut self, bb: BasicBlock) {
                     location, live_local
                 );
 
-                self.flow_inits.each_state_bit(|mpi_init| {
-                    debug!(
-                        "add_liveness_constraints: location={:?} initialized={:?}",
-                        location,
-                        &self.flow_inits.operator().move_data().move_paths[mpi_init]
-                    );
-                });
+                if log_enabled!(::log::Level::Debug) {
+                    self.flow_inits.each_state_bit(|mpi_init| {
+                        debug!(
+                            "add_liveness_constraints: location={:?} initialized={:?}",
+                            location,
+                            &self.flow_inits.operator().move_data().move_paths[mpi_init]
+                        );
+                    });
+                }
 
                 let mpi = self.move_data.rev_lookup.find_local(live_local);
                 if let Some(initialized_child) = self.flow_inits.has_any_child_of(mpi) {