summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-07-28 13:27:03 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2009-07-28 13:27:03 +0200
commit2edcefd596307b2a5fecbfb43bf0f43bc35b269f (patch)
tree1129df0475d516061b259dabe36ad4468a5f3f4b
parent1e9f840254a9ae2b432e5c9d80bc32bf5df8464e (diff)
apt-pkg/depcache.cc:
- Call opProgress->Update() less often too avoid spending too much time in it (it shows up relatively high in the callgrind logs). But do call it more often than just for each percent so that the UI frontends can use the OpProgress::Update() calling to do e.g. UI updates
-rw-r--r--apt-pkg/depcache.cc10
1 files changed, 2 insertions, 8 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 5c011d743..13abbe5ed 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -127,12 +127,9 @@ bool pkgDepCache::Init(OpProgress *Prog)
/* Set the current state of everything. In this state all of the
packages are kept exactly as is. See AllUpgrade */
int Done = 0;
- int Update_interval = Head().PackageCount/100;
- if (Update_interval == 0)
- Update_interval = 1;
for (PkgIterator I = PkgBegin(); I.end() != true; I++,Done++)
{
- if (Prog != 0 && Done%Update_interval == 0)
+ if (Prog != 0 && Done%20 == 0)
Prog->Progress(Done);
// Find the proper cache slot
@@ -615,12 +612,9 @@ void pkgDepCache::Update(OpProgress *Prog)
// Perform the depends pass
int Done = 0;
- int Update_interval = Head().PackageCount;
- if (Update_interval == 0)
- Update_interval = 1;
for (PkgIterator I = PkgBegin(); I.end() != true; I++,Done++)
{
- if (Prog != 0 && Done%Update_interval == 0)
+ if (Prog != 0 && Done%20 == 0)
Prog->Progress(Done);
for (VerIterator V = I.VersionList(); V.end() != true; V++)
{