Skip to content

Commit ab2454d

Browse files
mhdawsoncodebytere
authored andcommittedJun 18, 2020
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 7c553cd commit ab2454d

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
@@ -65,13 +65,13 @@ class WorkerThreadsTaskRunner::DelayedTaskScheduler {
6565
}
6666

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.