From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 Date: Thu, 12 Dec 2019 22:55:53 +0300 From: Andrey Savchenko To: ALT Linux Team development discussions Message-Id: <20191212225553.e467fee203adc96d3a6060e0@altlinux.org> In-Reply-To: <20191212095730.83787-10-darktemplar@altlinux.org> References: <20191211234857.GB17949@altlinux.org> <20191212095730.83787-1-darktemplar@altlinux.org> <20191212095730.83787-10-darktemplar@altlinux.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA512"; boundary="Signature=_Thu__12_Dec_2019_22_55_53_+0300_pbEoLgvBlmfGeJJj" Subject: Re: [devel] [PATCH for apt v2 09/21] Rework identical conditions X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 19:56:02 -0000 Archived-At: List-Archive: List-Post: --Signature=_Thu__12_Dec_2019_22_55_53_+0300_pbEoLgvBlmfGeJJj Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, 12 Dec 2019 12:57:18 +0300 Aleksei Nikiforov wrote: > Found via cppcheck: > [apt/methods/rsync.cc:371] -> [apt/methods/rsync.cc:373]: > (style) The if condition is the same as the previous if condition > --- > apt/cmdline/apt-shell.cc | 7 +++++-- > apt/methods/rsync.cc | 3 ++- > 2 files changed, 7 insertions(+), 3 deletions(-) >=20 > diff --git a/apt/cmdline/apt-shell.cc b/apt/cmdline/apt-shell.cc > index 36fa223..951bc3c 100644 > --- a/apt/cmdline/apt-shell.cc > +++ b/apt/cmdline/apt-shell.cc > @@ -3044,8 +3044,9 @@ bool DoList(CommandLine &CmdL) > PkgSection =3D Pkg.Section(); > StrLen =3D strlen(Str); > string status =3D "available"; > - if (Pkg->CurrentVer !=3D 0) status =3D "installed"; > - if (Pkg->CurrentVer !=3D 0) > + if (Pkg->CurrentVer !=3D 0) > + { > + status =3D "installed"; > for (pkgCache::DepIterator D =3D Pkg.RevDependsList(); not= D.end(); ++D) > { > pkgCache::PkgIterator P =3D D.ParentPkg(); > @@ -3053,7 +3054,9 @@ bool DoList(CommandLine &CmdL) > (P->Flags & pkgCache::Flag::Important) !=3D pkgCache::Flag::I= mportant) > continue; > status =3D "locked"; > + break; Why this break? It does not look related to the identical conditions merge. > } > + } > if (Pkg->CurrentVer !=3D 0 && Cache[Pkg].Upgradable() =3D=3D true) = status =3D "upgradable"; > if (Cache[Pkg].NewInstall()) status =3D "be-installed"; > if (Cache[Pkg].Delete()) status =3D "be-removed"; > diff --git a/apt/methods/rsync.cc b/apt/methods/rsync.cc > index bae22eb..64c9231 100644 > --- a/apt/methods/rsync.cc > +++ b/apt/methods/rsync.cc > @@ -369,9 +369,10 @@ bool RsyncMethod::RsyncConnExec::Get(pkgAcqMethod *O= wner, FetchResult &FRes, con > return false; > } > if ( RsyncMethod::Debug ) > + { > cerr << "RSYNC: Created pipe [" << p[0] << ',' << p[1] << ']' << endl; > - if ( RsyncMethod::Debug ) > cerr << "RSYNC: Starting: " << string(argv) << endl; > + } > =20 > switch ( ChildPid =3D fork() ) { > case -1: Best regards, Andrew Savchenko --Signature=_Thu__12_Dec_2019_22_55_53_+0300_pbEoLgvBlmfGeJJj Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE63ZIHsdeM+1XgNer9lNaM7oe5I0FAl3ym0kACgkQ9lNaM7oe 5I304w//Rd2CtpfOs+N7spiw0NjS5Gp0PL3xCXKX3cg61GsNUdTc2ww3nz8XKjXl wrR41MybSymLvSkBhNL3lHdVSqcl+vdAu2+UTkA9apyWavi9Zzlo1QosDJFgbjHG atEAjoTx8QY/Hs5ejQG25od/c6iyNJveAHU6Joa/yd0sqxn+8IMr+SYtjOvsrfhc 2vIX96eF5atUtLQ6d/kbP1flJpe1xDcnBln4YvNE1abjCucHDE9GSTwVSWZFjWXR urGwiQX8uVEhe9wZ45csXXImRY0CspBLjqqIxUWRycDl1nh9i8DWLiH6Er2MV22k shsx4tNriOkEKyFK6+WTGJNzNYBXxl51KTJl3xStNaJf3iSpJe1STscIJvAkkvep 2TWl4pV/PJWsqIkgwOW0rB07g27v9QMucxJ7cRH4zeRBSYa4Qtpg4A3wYSNJNkto TyKm1Fn5HfqC26Z2I64uuTQ7ijohDPRRhaP4NSMWsDcH3nFPhlUxwBqYL8gyMnBn e/HnMNYvfGR0hQjgkVDFKqCrAeWe0vl1c0cSJg+sKJtUpCiIzyoAB6RDCcLWu2yT 0noCvzDmhyjSvF193KY2LmH408zjXpHdQXTrTeNXX40orTyhbH/IqbbBwnDSiowT g/OMnqnA/ZGgsrAlFmuEzgXHnHp4TvrO7smpw6vfPOd1Uoi/TA8= =W3xS -----END PGP SIGNATURE----- --Signature=_Thu__12_Dec_2019_22_55_53_+0300_pbEoLgvBlmfGeJJj--