Re: [PATCH] md: make the code more readable in the for-loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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).

NeilBrown

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux