From 4661a0f228193938bdd9a15bdb0da4607a6bc8d7 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Tue, 25 Jan 2022 15:04:06 -0500 Subject: [PATCH] LibJS: Use forwarding references for call's variadic template arguments --- Userland/Libraries/LibJS/Runtime/AbstractOperations.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/AbstractOperations.h b/Userland/Libraries/LibJS/Runtime/AbstractOperations.h index 6587d9d0d2..0eabffc0ad 100644 --- a/Userland/Libraries/LibJS/Runtime/AbstractOperations.h +++ b/Userland/Libraries/LibJS/Runtime/AbstractOperations.h @@ -65,11 +65,11 @@ ALWAYS_INLINE ThrowCompletionOr call(GlobalObject& global_object, Value f } template -ALWAYS_INLINE ThrowCompletionOr call(GlobalObject& global_object, Value function, Value this_value, Args... args) +ALWAYS_INLINE ThrowCompletionOr call(GlobalObject& global_object, Value function, Value this_value, Args&&... args) { if constexpr (sizeof...(Args) > 0) { MarkedValueList arguments_list { global_object.heap() }; - (..., arguments_list.append(move(args))); + (..., arguments_list.append(forward(args))); return call_impl(global_object, function, this_value, move(arguments_list)); } @@ -87,11 +87,11 @@ ALWAYS_INLINE ThrowCompletionOr call(GlobalObject& global_object, Functio } template -ALWAYS_INLINE ThrowCompletionOr call(GlobalObject& global_object, FunctionObject& function, Value this_value, Args... args) +ALWAYS_INLINE ThrowCompletionOr call(GlobalObject& global_object, FunctionObject& function, Value this_value, Args&&... args) { if constexpr (sizeof...(Args) > 0) { MarkedValueList arguments_list { global_object.heap() }; - (..., arguments_list.append(move(args))); + (..., arguments_list.append(forward(args))); return call_impl(global_object, function, this_value, move(arguments_list)); }