From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xoxnj-0000yM-JY for qemu-devel@nongnu.org; Thu, 13 Nov 2014 12:03:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xoxne-0002PU-Ja for qemu-devel@nongnu.org; Thu, 13 Nov 2014 12:03:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xoxnc-0002PH-Si for qemu-devel@nongnu.org; Thu, 13 Nov 2014 12:03:14 -0500 Message-ID: <5464E44C.4070609@redhat.com> Date: Thu, 13 Nov 2014 10:03:08 -0700 From: Eric Blake MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wawgKsqahgllMjx1GT84ngjiR6E0rTLB7" Subject: Re: [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gary Hook , "qemu-devel@nongnu.org" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wawgKsqahgllMjx1GT84ngjiR6E0rTLB7 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 11/13/2014 09:44 AM, Gary Hook wrote: [metacomment] > On 11/13/14, 6:46 AM, "Markus Armbruster" > wrote: >=20 > Stefan Hajnoczi > writes:= >=20 > On Wed, Nov 12, 2014 at 06:48:18PM +0000, Gary Hook wrote: Your quoting style leaves a lot to be desired. While you correctly attributed multiple contributors of the material quoted below... > - return qemu_ftell(f) - last_ftell; > + delta_ftell =3D qemu_ftell(f) - last_ftell; > + return( (delta_ftell > 0) ? 1 : (delta_ftell < 0) ? -1 : 0 ); >=20 > Good find! >=20 > Please don't nest the ternary operator, it is hard to read. >=20 > if (delta_ftell < 0) { > return -1; > } else if (delta_ftell > 0) { > return 1; > } else { > return 0; > } >=20 > Bah, that's for wimps ;) >=20 > return (delta_ftell > 0) - (delta_ftell < 0); >=20 > Look ma, no branches! >=20 > Ha-ha! Very good, but even less readable than the compressed ternary ve= rsion, > IMO. This function only gets called once per migration; I don't see a f= ew branches as performance-critical and worth the sacrifice of clarity as= to intent. =2E..all three sets of contributions were listed with NO differentiation in indentation or leading '>' or other indication which part was quoted vs. which part was new material from you. Most people on this list use a REAL mail agent (such as mutt or Thunderbird), and avoid web mail, precisely because most web mail implementations are absolutely lousy at writing decently threaded conversations. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --wawgKsqahgllMjx1GT84ngjiR6E0rTLB7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJUZORMAAoJEKeha0olJ0NqyD0H/17qBRGjCy81x6HxbD/+a0l5 Y4P4/9OpvlCi276J8pTZOoabWPZALBd0Tc19mDE6y0oJV4EjZcGjGTYR4qnTXtja 1pUR4xoSYSHZCwrIfNsGwI0W/yDEfEN5GGEa5H61jdAZwBKr58RVEEn770cc+gxx CVqzsnwirsmU1KErtAABVVLS2bCx7Sl6WYwUtg4r2XS+JE0BB9FGhydPX6TZMuPx Juh1X7siMmJzu//qtwcntsB+XEo/w3k4OKbpCcBLaAGhiYnP3JLYrWVrWC0GZWXH owqjvBzUghwXpYCOA487018O1paCPTvRakKziiYMYbRXxoVC66nkOddJPDgWdvk= =1zOC -----END PGP SIGNATURE----- --wawgKsqahgllMjx1GT84ngjiR6E0rTLB7--