Skip to content

Commit 6f6fb1f

Browse files
mhdawsoncodebytere
authored andcommitted
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 <[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]>
1 parent c697b96 commit 6f6fb1f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/node_platform.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ class WorkerThreadsTaskRunner::DelayedTaskScheduler {
6666
}
6767

6868
void PostDelayedTask(std::unique_ptr<Task> task, double delay_in_seconds) {
69-
tasks_.Push(std::unique_ptr<Task>(new ScheduleTask(this, std::move(task),
70-
delay_in_seconds)));
69+
tasks_.Push(std::make_unique<ScheduleTask>(this, std::move(task),
70+
delay_in_seconds));
7171
uv_async_send(&flush_tasks_);
7272
}
7373

7474
void Stop() {
75-
tasks_.Push(std::unique_ptr<Task>(new StopTask(this)));
75+
tasks_.Push(std::make_unique<StopTask>(this));
7676
uv_async_send(&flush_tasks_);
7777
}
7878

0 commit comments

Comments
 (0)