mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:57:35 +00:00
LibWasm: Move some Values and Vector<Value>s instead of copying them
This commit is contained in:
parent
fa2ae02564
commit
8b6397446e
2 changed files with 5 additions and 7 deletions
|
@ -42,10 +42,8 @@ Result Configuration::call(Interpreter& interpreter, FunctionAddress address, Ve
|
|||
if (!function)
|
||||
return Trap {};
|
||||
if (auto* wasm_function = function->get_pointer<WasmFunction>()) {
|
||||
Vector<Value> locals;
|
||||
locals.ensure_capacity(arguments.size() + wasm_function->code().locals().size());
|
||||
for (auto& value : arguments)
|
||||
locals.append(Value { value });
|
||||
Vector<Value> locals = move(arguments);
|
||||
locals.ensure_capacity(locals.size() + wasm_function->code().locals().size());
|
||||
for (auto& type : wasm_function->code().locals())
|
||||
locals.empend(type, 0ull);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue