diff options
author | David Kalnischkies <kalnischkies@gmail.com> | 2010-11-30 18:54:27 +0100 |
---|---|---|
committer | David Kalnischkies <kalnischkies@gmail.com> | 2010-11-30 18:54:27 +0100 |
commit | 08fa1cab614ec50d2b1de807439195c71d1530cf (patch) | |
tree | a89f62842a6d7a685b76e348aad7ee2c35485d29 | |
parent | 4279ef3b0a35327a03955461fff3cd6821463457 (diff) |
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)
-rw-r--r-- | apt-pkg/depcache.cc | 11 |
1 files 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]; |