don't clone the MIR Rc in every iteration

This commit is contained in:
Oliver Schneider 2016-06-01 13:55:16 +02:00
parent 8398781132
commit 5a8b0ab579
No known key found for this signature in database
GPG key ID: 56D6EEA0FC67AC46

View file

@ -186,10 +186,10 @@ impl<'a, 'b, 'mir, 'tcx> FnEvalContext<'a, 'b, 'mir, 'tcx> {
fn run(&mut self) -> EvalResult<()> {
'outer: while !self.stack.is_empty() {
let mut current_block = self.frame().next_block;
let current_mir = self.mir();
loop {
trace!("// {:?}", current_block);
let current_mir = self.mir().clone(); // Cloning a reference.
let block_data = current_mir.basic_block_data(current_block);
for stmt in &block_data.statements {