mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-18 08:20:44 +00:00
LibWasm: Move some Values and Vector<Value>s instead of copying them
This commit is contained in:
parent
fa2ae02564
commit
8b6397446e
Notes:
sideshowbarker
2024-07-18 07:03:47 +09:00
Author: https://github.com/alimpfard
Commit: 8b6397446e
Pull-request: https://github.com/SerenityOS/serenity/pull/9278
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