From 23dba65f031954df896bc3c6dfb1a9705574886b Mon Sep 17 00:00:00 2001 From: Herman Semenoff Date: Wed, 8 Apr 2026 12:58:55 +0300 Subject: apt: modernize to make_unique C++17 References: - https://stackoverflow.com/questions/79700634/pros-and-cons-of-make-unique-vs-direct-constructor-call-in-c17 - https://towardsdev.com/why-std-make-unique-beats-new-in-modern-c-7e2ba653737e - https://www.sololearn.com/en/Discuss/3334779/where-make_unique-is-better-than-unique_ptrraw-pointer --- apt-pkg/orderlist.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg/orderlist.cc') diff --git a/apt-pkg/orderlist.cc b/apt-pkg/orderlist.cc index 33d17fcec..83d2f2fb4 100644 --- a/apt-pkg/orderlist.cc +++ b/apt-pkg/orderlist.cc @@ -137,8 +137,8 @@ bool pkgOrderList::DoRun() { // Temp list unsigned long Size = Cache.Head().PackageCount; - std::unique_ptr NList(new Package *[Size]); - std::unique_ptr AfterList(new Package *[Size]); + auto NList = std::make_unique(Size); + auto AfterList = std::make_unique(Size); AfterEnd = AfterList.get(); Depth = 0; -- cgit v1.2.3-70-g09d2