summaryrefslogtreecommitdiff
path: root/apt-pkg/algorithms.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2026-04-08 10:41:49 +0000
committerJulian Andres Klode <jak@debian.org>2026-04-08 10:41:49 +0000
commit65b3ff4a262e73a71467f1aab5bdf2e1a9e00170 (patch)
tree1f40f2afce10e3b793540e9905b624f113c2ee15 /apt-pkg/algorithms.cc
parentfbde7ea4ce304a30e155a2bd9d014d196abbb496 (diff)
parent23dba65f031954df896bc3c6dfb1a9705574886b (diff)
Merge branch 'make-unique' into 'main'
apt: modernize to make_unique C++17 See merge request apt-team/apt!567
Diffstat (limited to 'apt-pkg/algorithms.cc')
-rw-r--r--apt-pkg/algorithms.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc
index a08ecd2c6..44f186a82 100644
--- a/apt-pkg/algorithms.cc
+++ b/apt-pkg/algorithms.cc
@@ -554,7 +554,7 @@ void pkgProblemResolver::MakeScores()
}
// Copy the scores to advoid additive looping
- std::unique_ptr<int[]> OldScores(new int[Size]);
+ auto OldScores = std::make_unique<int[]>(Size);
memcpy(&OldScores[0],&Scores[0],sizeof(Scores[0])*Size);
/* Now we cause 1 level of dependency inheritance, that is we add the
@@ -797,7 +797,7 @@ bool pkgProblemResolver::ResolveInternal(bool const BrokenFix)
operates from highest score to lowest. This prevents problems when
high score packages cause the removal of lower score packages that
would cause the removal of even lower score packages. */
- std::unique_ptr<pkgCache::Package *[]> PList(new pkgCache::Package *[Size]);
+ auto PList = std::make_unique<pkgCache::Package *[]>(Size);
pkgCache::Package **PEnd = &PList[0];
for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
*PEnd++ = I;
@@ -1291,7 +1291,7 @@ bool pkgProblemResolver::ResolveByKeepInternal()
high score packages cause the removal of lower score packages that
would cause the removal of even lower score packages. */
auto Size = Cache.Head().PackageCount;
- std::unique_ptr<pkgCache::Package *[]> PList{new pkgCache::Package *[Size]};
+ auto PList = std::make_unique<pkgCache::Package *[]>(Size);
pkgCache::Package **PEnd = &PList[0];
for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
*PEnd++ = I;