[wasm] Fix for perfect forwarding

We don't currently depend on this, but it might improve performance by
avoiding intermediate copies. The functions are already set up for
perfect forwarding, but without declaring the parameters as forwarding
references, this does not work as expected.

R=ahaas@chromium.org

Change-Id: I2c4d96ea1108b3f884d3e581e74c20aafd232934
Reviewed-on: https://chromium-review.googlesource.com/497409
Reviewed-by: Andreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45158}
This commit is contained in:
Clemens Hammacher 2017-05-08 11:51:55 +02:00 committed by Commit Bot
parent d958ecf448
commit 4e7c416dc4

View File

@ -2668,7 +2668,7 @@ class AsyncCompileJob {
};
template <typename Task, typename... Args>
void DoSync(Args... args) {
void DoSync(Args&&... args) {
static_assert(Task::type == SYNC, "Scheduled type must be sync");
Task* task = new Task(std::forward<Args>(args)...);
task->job_ = this;
@ -2677,7 +2677,7 @@ class AsyncCompileJob {
}
template <typename Task, typename... Args>
void DoAsync(Args... args) {
void DoAsync(Args&&... args) {
static_assert(Task::type == ASYNC, "Scheduled type must be async");
Task* task = new Task(std::forward<Args>(args)...);
task->job_ = this;