Re: [PATCH v2 03/18] maintenance: replace run_auto_gc()

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

 



On 7/30/2020 3:00 PM, Eric Sunshine wrote:
> On Thu, Jul 30, 2020 at 9:31 AM Derrick Stolee <stolee@xxxxxxxxx> wrote:
>> int run_auto_maintenance(int quiet)
>> {
>>         struct child_process maint = CHILD_PROCESS_INIT;
>>         maint.git_cmd = 1;
>>
>>         argv_array_pushl(&maint.args, "maintenance", "run", "--auto", NULL);
>>         if (quiet)
>>                 argv_array_push(&maint.args, "--quiet");
>>         else
>>                 argv_array_push(&maint.args, "--no-quiet");
> 
> It's subjective, but this might be a good fit for the ternary operator:
> 
>     argv_array_pushl(&maint.args, "maintenance", "run", "--auto", NULL);
>     argv_array_push(&maint.args, quiet ? "--quiet" : "--no-quiet");

Good idea! Thanks.

> Or even:
> 
>     argv_array_pushl(&maint.args, "maintenance", "run", "--auto",
>         quiet ? "--quiet" : "--no-quiet", NULL);
> 
> The latter is a bit less readable to me.

I agree.
-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