From: Eric Blake <eblake@redhat.com>
To: Gary Hook <gary.hook@nimboxx.com>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch
Date: Thu, 13 Nov 2014 10:03:08 -0700 [thread overview]
Message-ID: <5464E44C.4070609@redhat.com> (raw)
In-Reply-To: <D08A3C06.4232%gary.hook@nimboxx.com>
[-- Attachment #1: Type: text/plain, Size: 1704 bytes --]
On 11/13/2014 09:44 AM, Gary Hook wrote:
[metacomment]
> On 11/13/14, 6:46 AM, "Markus Armbruster" <armbru@redhat.com<mailto:armbru@redhat.com>> wrote:
>
> Stefan Hajnoczi <stefanha@gmail.com<mailto:stefanha@gmail.com>> writes:
>
> 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 = qemu_ftell(f) - last_ftell;
> + return( (delta_ftell > 0) ? 1 : (delta_ftell < 0) ? -1 : 0 );
>
> Good find!
>
> Please don't nest the ternary operator, it is hard to read.
>
> if (delta_ftell < 0) {
> return -1;
> } else if (delta_ftell > 0) {
> return 1;
> } else {
> return 0;
> }
>
> Bah, that's for wimps ;)
>
> return (delta_ftell > 0) - (delta_ftell < 0);
>
> Look ma, no branches!
>
> Ha-ha! Very good, but even less readable than the compressed ternary version,
> IMO. This function only gets called once per migration; I don't see a few branches as performance-critical and worth the sacrifice of clarity as to intent.
...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.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]
next prev parent reply other threads:[~2014-11-13 17:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-13 16:44 [Qemu-devel] [PATCH 1/1] block migration: fix return value mismatch Gary Hook
2014-11-13 17:03 ` Eric Blake [this message]
2014-11-13 17:32 ` Gary Hook
2014-11-13 18:55 ` Stefan Hajnoczi
2014-11-13 21:12 ` Gary R Hook
-- strict thread matches above, loose matches on Subject: below --
2014-11-21 18:08 Gary R Hook
2014-11-24 9:10 ` Dr. David Alan Gilbert
2014-11-13 16:43 Gary Hook
2014-11-12 18:48 Gary Hook
2014-11-12 20:27 ` Eric Blake
2014-11-13 7:57 ` Markus Armbruster
2014-11-13 11:20 ` Stefan Hajnoczi
2014-11-13 12:46 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5464E44C.4070609@redhat.com \
--to=eblake@redhat.com \
--cc=gary.hook@nimboxx.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).