summaryrefslogtreecommitdiff
path: root/apt-private
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2022-08-31 16:08:54 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2022-09-02 22:32:59 +0200
commit009cf61122b7a0ac22b541035a26e6092c9ac529 (patch)
treeda0037a28e646d997c874faa3955d24ad00e3d84 /apt-private
parent6499f7dc842ebd621f11ea01e83ccbe4125a0581 (diff)
Avoid triggering unused variable ‘State’ in doAutoInstall
Reported-By: gcc Gbp-Dch: Ignore
Diffstat (limited to 'apt-private')
-rw-r--r--apt-private/private-install.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc
index 4cddc3e0c..34cc69805 100644
--- a/apt-private/private-install.cc
+++ b/apt-private/private-install.cc
@@ -1095,11 +1095,9 @@ bool TryToInstall::propagateReleaseCandidateSwitching(std::list<std::pair<pkgCac
}
/*}}}*/
void TryToInstall::doAutoInstall() { /*{{{*/
- for (APT::PackageSet::const_iterator P = doAutoInstallLater.begin();
- P != doAutoInstallLater.end(); ++P) {
- pkgDepCache::StateCache &State = (*Cache)[P];
- Cache->GetDepCache()->MarkInstall(P, true);
- }
+ auto * const DCache = Cache->GetDepCache();
+ for (auto const &P: doAutoInstallLater)
+ DCache->MarkInstall(P, true);
doAutoInstallLater.clear();
}
/*}}}*/