src: prefer make_unique

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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Michael Dawson authored and Shelley Vohr committed 2020-07-06 09:59:30 -07:00
1 parent c697b96dea
commit 6f6fb1fcf5
1 file changed
+3 -3
+3 -3
View File
@@ -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_);
}