From 26eb8131daf951e70dad3230115e38c853a20c47 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 12 Dec 2018 14:20:36 -0800 Subject: [PATCH] Avoid unnecessary clone() calls. --- lib/runtime/src/instance.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/runtime/src/instance.rs b/lib/runtime/src/instance.rs index 4322cddbe5..64c90b6622 100644 --- a/lib/runtime/src/instance.rs +++ b/lib/runtime/src/instance.rs @@ -216,11 +216,10 @@ impl Instance { if let Some(start_index) = self.module.start_func { let (callee_address, callee_vmctx) = match self.module.defined_func_index(start_index) { Some(defined_start_index) => { - let body = self + let body = *self .finished_functions .get(defined_start_index) - .expect("start function index is out of bounds") - .clone(); + .expect("start function index is out of bounds"); (body, self.vmctx_mut() as *mut VMContext) } None => { @@ -302,7 +301,7 @@ impl Instance { } else { unsafe { self.vmctx.imported_global(*index).from } }, - global: self.module.globals[*index].clone(), + global: self.module.globals[*index], }, }) } else {