From 08fa1cab614ec50d2b1de807439195c71d1530cf Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 30 Nov 2010 18:54:27 +0100 Subject: [PATCH] apply a very simple speed-up in case we try to set the candidate version of a package to the version which is already the candidate (apt-get does that for all packages it installs for simplicity) --- apt-pkg/depcache.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 23abc76c1..58e7ebf07 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1510,11 +1510,15 @@ void pkgDepCache::SetReInstall(PkgIterator const &Pkg,bool To) /* */ void pkgDepCache::SetCandidateVersion(VerIterator TargetVer, bool const &Pseudo) { - ActionGroup group(*this); pkgCache::PkgIterator Pkg = TargetVer.ParentPkg(); StateCache &P = PkgState[Pkg->ID]; + if (P.CandidateVer == TargetVer) + return; + + ActionGroup group(*this); + RemoveSizes(Pkg); RemoveStates(Pkg); @@ -1549,7 +1553,10 @@ void pkgDepCache::SetCandidateVersion(VerIterator TargetVer, bool const &Pseudo) } } } - + /*}}}*/ +// DepCache::MarkAuto - set the Auto flag for a package /*{{{*/ +// --------------------------------------------------------------------- +/* */ void pkgDepCache::MarkAuto(const PkgIterator &Pkg, bool Auto) { StateCache &state = PkgState[Pkg->ID]; -- 2.45.2