0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 15:06:33 +01:00

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 2020-05-12 16:04:02 -04:00
parent 81216a349d
commit 4c4c226359

View File

@ -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_);
}