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 <michael_dawson@ca.ibm.com>

PR-URL: #33378
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
  • Loading branch information
mhdawson authored and codebytere committed Jul 6, 2020
1 parent c697b96 commit 6f6fb1f
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 @@ -66,13 +66,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 6f6fb1f

Please sign in to comment.