summaryrefslogtreecommitdiff
path: root/apt-pkg/depcache.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2010-05-29 19:02:32 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2010-05-29 19:02:32 +0200
commit461e4a5e0d30549e5b9758ce816027d92747f00d (patch)
treee03e862cfdfe73a11abe0c36860af2d94e09a6f3 /apt-pkg/depcache.cc
parentb3fdb998016beb8bf3d8bedb3ad6218f9050eece (diff)
* apt-pkg/depcache.cc:
- correct "Dangerous iterator usage." pointed out by cppcheck
Diffstat (limited to 'apt-pkg/depcache.cc')
-rw-r--r--apt-pkg/depcache.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index afec7ba83..6c73b9cfd 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -806,7 +806,7 @@ void pkgDepCache::Update(OpProgress *Prog)
a bit we increase with a kill, but we should do something more clever… */
while(recheck.empty() == false)
for (std::set<unsigned long>::const_iterator p = recheck.begin();
- p != recheck.end(); ++p) {
+ p != recheck.end();) {
if (Prog != 0 && Done%20 == 0)
Prog->Progress(Done);
PkgIterator P = PkgIterator(*Cache, Cache->PkgP + *p);
@@ -814,7 +814,7 @@ void pkgDepCache::Update(OpProgress *Prog)
++killed;
++Done;
}
- recheck.erase(p);
+ recheck.erase(p++);
}
/* Okay, we have killed a great amount of pseudopackages -
@@ -849,7 +849,7 @@ void pkgDepCache::Update(OpProgress *Prog)
unsigned long const G = *g;
recheck.erase(g);
if (unlikely(ReInstallPseudoForGroup(G, recheck) == false))
- _error->Warning(_("Internal error, group '%s' has no installable pseudo package"), GrpIterator(*Cache, Cache->GrpP + *g).Name());
+ _error->Warning(_("Internal error, group '%s' has no installable pseudo package"), GrpIterator(*Cache, Cache->GrpP + G).Name());
}
}