Re: [PATCH v5 2/3] reftable/stack: add env to disable autocompaction

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

 



Patrick Steinhardt <ps@xxxxxx> writes:

>> @@ -248,6 +249,9 @@ static struct ref_store *reftable_be_init(struct repository *repo,
>>  	refs->write_options.hash_id = repo->hash_algo->format_id;
>>  	refs->write_options.default_permissions = calc_shared_perm(0666 & ~mask);
>>  
>> +	if (!git_env_bool("GIT_TEST_REFTABLE_AUTOCOMPACTION", 1))
>> +		refs->write_options.disable_auto_compact = 1;
>> +
>
> This could be simplified to:
>
>     ```
>     refs->write_options.disable_auto_compact =
>             !git_env_bool("GIT_TEST_REFTABLE_AUTOCOMPACTION", 1);
>     ```

I presume that the .disable_auto_compact member is off initially,
given that this is inside reftable_be_init(), but your rewrite makes
it easier on readers, as they do not have to know what value the
member originally has at this point in the flow.  So even though it
replaces two lines of code with another two lines of code, it does
count as a valuable simplification at the conceptual level.

Thanks.





[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