Re: [PATCH v2 3/4] t-reftable-readwrite: use 'for' in place of infinite 'while' loops

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

 



Chandra Pratap <chandrapratap3519@xxxxxxxxx> writes:

> Using a for loop with an empty conditional statement is more concise
> and easier to read than an infinite 'while' loop in instances
> where we need a loop variable. Hence, replace such instances of a
> 'while' loop with the equivalent 'for' loop.

Quite honestly, the above is counter-productive if pushed as a
general guideline, because the goodness of it depends what happens
in the third part of the for () control (i.e., what should happen at
the end of each iteration and if it wants to be bypassed in the
conditional inside the loop).

In this particular case, it probably is OK, but still is a
subjective, borderline Meh, to me.

I see no violation of correctness in the rewrite, though ;-)





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux