Commit 4e7c416d authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

[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/497409Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45158}
parent d958ecf4
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment