Re: [PATCH 4/5] commit-graph: refactor dispatch loop for style

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

 



On 2/16/2021 7:02 AM, Ævar Arnfjörð Bjarmason wrote:
> 
> On Tue, Feb 16 2021, Derrick Stolee wrote:
>> The other patches solve real readability problems or reorganize the code
>> to use other concepts within the codebase. This one is much more optional.
> 
> What do you think about
> https://lore.kernel.org/git/874kidapv7.fsf@xxxxxxxxxxxxxxxxxxx/ ? :)

Using a 'goto' is a fine way to avoid a nesting level, but I'm not sure
it "improves readability." Having the tab level makes it clear that that
code is executed only when some condition is met, in this case "if (argc),"
while with the 'goto' we need to know that execution was redirected.

I don't feel too strongly either way. If the code was presented one way or
the other, I probably wouldn't recommend changing to the other mode. In
that sense, the change isn't necessary and causes me to break the tie in
favor of leaving it where it is.

Of course, if someone else says "I like this and would prefer it be used
as an example for future contributors" then the tie is broken in the other
way.

Thanks,
-Stolee



[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