From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: NeilBrown <nfbrown@novell.com>
Cc: Shaohua Li <shli@kernel.org>,
Eyal Lebedinsky <eyal@eyal.emu.id.au>,
linux-raid@vger.kernel.org
Subject: Re: [PATCH] md: make the code more readable in the for-loop
Date: Mon, 09 May 2016 16:45:38 -0400 [thread overview]
Message-ID: <wrfjd1ovrmdp.fsf@redhat.com> (raw)
In-Reply-To: <87inynu4he.fsf@notabene.neil.brown.name> (NeilBrown's message of "Mon, 09 May 2016 16:31:41 +1000")
NeilBrown <nfbrown@novell.com> writes:
> On Mon, May 09 2016, Shaohua Li wrote:
>
>> On Mon, May 09, 2016 at 09:33:39AM +1000, Eyal Lebedinsky wrote:
>>> I do not see how this change makes it clearer. The original form is
>>> actually a very common and clear
>>> scan an array in reverse order
>>
>> People always have different opinions for this stuff. When I read '--j' or
>> 'j--', I always think extra time what the value of j is. So for me the change
>> actually makes the code more readable :)
>
> If the goal is to make the code more readable, you may as well make it:
>
> for (j = 0; i < ->raid_disk; j++)
>
> That will be clearer to most people than the current code, which I don't
> think is very much clearer than the original (maybe a little bit).
I agree - I had to read the updated version multiple times to convince
myself it was doing the same thing as the original.
Cheers,
Jes
next prev parent reply other threads:[~2016-05-09 20:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-08 12:56 [PATCH] md: make the code more readable in the for-loop Tiezhu Yang
2016-05-08 23:03 ` Shaohua Li
2016-05-08 23:33 ` Eyal Lebedinsky
2016-05-09 3:53 ` Shaohua Li
2016-05-09 6:31 ` NeilBrown
2016-05-09 20:45 ` Jes Sorensen [this message]
2016-05-11 0:29 ` Shaohua Li
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=wrfjd1ovrmdp.fsf@redhat.com \
--to=jes.sorensen@redhat.com \
--cc=eyal@eyal.emu.id.au \
--cc=linux-raid@vger.kernel.org \
--cc=nfbrown@novell.com \
--cc=shli@kernel.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).