Skip to content

Commit

Permalink
Use vec.push instead of .insert for vmctx arg
Browse files Browse the repository at this point in the history
  • Loading branch information
syrusakbary committed Feb 12, 2019
1 parent b7c3cc0 commit b641606
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/clif-backend/src/func_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,8 @@ impl<'env, 'module, 'isa> FuncEnvironment for FuncEnv<'env, 'module, 'isa> {
// Build a value list for the indirect call instruction containing the call_args
// and the vmctx parameter.
let mut args = Vec::with_capacity(call_args.len() + 1);
args.push(vmctx_ptr);
args.extend(call_args.iter().cloned());
args.insert(0, vmctx_ptr);

Ok(pos.ins().call_indirect(sig_ref, func_ptr, &args))
}
Expand All @@ -485,8 +485,8 @@ impl<'env, 'module, 'isa> FuncEnvironment for FuncEnv<'env, 'module, 'isa> {
.expect("missing vmctx parameter");

let mut args = Vec::with_capacity(call_args.len() + 1);
args.push(vmctx);
args.extend(call_args.iter().cloned());
args.insert(0, vmctx);

Ok(pos.ins().call(callee, &args))
}
Expand Down Expand Up @@ -532,8 +532,8 @@ impl<'env, 'module, 'isa> FuncEnvironment for FuncEnv<'env, 'module, 'isa> {
let sig_ref = pos.func.dfg.ext_funcs[callee].signature;

let mut args = Vec::with_capacity(call_args.len() + 1);
args.push(imported_vmctx_addr);
args.extend(call_args.iter().cloned());
args.insert(0, imported_vmctx_addr);

Ok(pos
.ins()
Expand Down

0 comments on commit b641606

Please sign in to comment.