Skip to content

Commit

Permalink
src: prefer make_unique
Browse files Browse the repository at this point in the history
In most of the code base we use make_unique instead of
new unique_ptr. Update node_platform.cc to be consistent
with that.

Signed-off-by: Michael Dawson <[email protected]>

PR-URL: #33378
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Zeyu Yang <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
  • Loading branch information
mhdawson authored and codebytere committed Jun 18, 2020
1 parent 7c553cd commit ab2454d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/node_platform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ class WorkerThreadsTaskRunner::DelayedTaskScheduler {
}

void PostDelayedTask(std::unique_ptr<Task> task, double delay_in_seconds) {
tasks_.Push(std::unique_ptr<Task>(new ScheduleTask(this, std::move(task),
delay_in_seconds)));
tasks_.Push(std::make_unique<ScheduleTask>(this, std::move(task),
delay_in_seconds));
uv_async_send(&flush_tasks_);
}

void Stop() {
tasks_.Push(std::unique_ptr<Task>(new StopTask(this)));
tasks_.Push(std::make_unique<StopTask>(this));
uv_async_send(&flush_tasks_);
}

Expand Down

0 comments on commit ab2454d

Please sign in to comment.