Re: [PATCH v2 03/18] maintenance: replace run_auto_gc()
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Jul 30, 2020, 20:21 UTC
- Message-ID
- <10439c4b-6f0b-6d37-d805-18a3ecc313d8@gmail.com>
- In-Reply-To
- <CAPig+cT50u=she6xm-zam-Qxtt5c7RTUTme+tj4GBGnQ_nus8g@mail.gmail.com>
On 7/30/2020 3:00 PM, Eric Sunshine wrote:
Show 16 quoted lines
> On Thu, Jul 30, 2020 at 9:31 AM Derrick Stolee <stolee@gmail.com> 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.
Show 6 quoted lines
> 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