summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2020-05-23 17:15:32 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2020-05-25 12:05:00 +0200
commitc77566fd8f21a1a44efb4092c90996d1cc8eaf24 (patch)
treeaafe70e850cb56cb242b3b7d1c938c6063e3503b /apt-pkg
parent0e5a9bf95d5b9b3c775ed3ce6142d35815a7c7ac (diff)
Don't update candidate provides map if the same as current
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/depcache.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 0f86640d5..b1447bb6c 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -827,15 +827,15 @@ void pkgDepCache::Update(PkgIterator const &Pkg)
Update(Pkg.RevDependsList());
// Update the provides map for the current ver
- if (Pkg->CurrentVer != 0)
- for (PrvIterator P = Pkg.CurrentVer().ProvidesList();
- P.end() != true; ++P)
+ auto const CurVer = Pkg.CurrentVer();
+ if (not CurVer.end())
+ for (PrvIterator P = CurVer.ProvidesList(); not P.end(); ++P)
Update(P.ParentPkg().RevDependsList());
// Update the provides map for the candidate ver
- if (PkgState[Pkg->ID].CandidateVer != 0)
- for (PrvIterator P = PkgState[Pkg->ID].CandidateVerIter(*this).ProvidesList();
- P.end() != true; ++P)
+ auto const CandVer = PkgState[Pkg->ID].CandidateVerIter(*this);
+ if (not CandVer.end() && CandVer != CurVer)
+ for (PrvIterator P = CandVer.ProvidesList(); not P.end(); ++P)
Update(P.ParentPkg().RevDependsList());
}
/*}}}*/