From 2b734a7ec429825c7007c1093883229e069d36c7 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 8 Jul 2019 15:48:59 +0200 Subject: Apply various suggestions by cppcheck Reported-By: cppcheck --- cmdline/apt-get.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'cmdline/apt-get.cc') diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc index 7ef07fbf0..5d81c08a4 100644 --- a/cmdline/apt-get.cc +++ b/cmdline/apt-get.cc @@ -148,8 +148,7 @@ static bool DoDSelectUpgrade(CommandLine &) pkgDepCache::ActionGroup group(Cache); // Install everything with the install flag set - pkgCache::PkgIterator I = Cache->PkgBegin(); - for (;I.end() != true; ++I) + for (pkgCache::PkgIterator I = Cache->PkgBegin(); I.end() != true; ++I) { /* Install the package only if it is a new install, the autoupgrader will deal with the rest */ @@ -159,7 +158,7 @@ static bool DoDSelectUpgrade(CommandLine &) /* Now install their deps too, if we do this above then order of the status file is significant for | groups */ - for (I = Cache->PkgBegin();I.end() != true; ++I) + for (pkgCache::PkgIterator I = Cache->PkgBegin(); I.end() != true; ++I) { /* Install the package only if it is a new install, the autoupgrader will deal with the rest */ @@ -168,7 +167,7 @@ static bool DoDSelectUpgrade(CommandLine &) } // Apply erasures now, they override everything else. - for (I = Cache->PkgBegin();I.end() != true; ++I) + for (pkgCache::PkgIterator I = Cache->PkgBegin(); I.end() != true; ++I) { // Remove packages if (I->SelectedState == pkgCache::State::DeInstall || -- cgit v1.2.3