Re: [PATCH v4 09/10] serve.[ch]: remove "serve_options", split up --advertise-refs code

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

 



On 8/4/2021 9:25 PM, Ævar Arnfjörð Bjarmason wrote:
...  
> -struct upload_pack_options {
> -	int stateless_rpc;
> -	int advertise_refs;
> -	unsigned int timeout;
> -	int daemon_mode;
> -};
> -
> -void upload_pack(struct upload_pack_options *options);
> +void upload_pack(const int advertise_refs, const int stateless_rpc,
> +		 const int timeout);

Normally, I would err on keeping a struct that presents the different
parameters of a complicated method, since it is easier to add options
without modifying all callers. However, in this case we already had
some confusion because the 'daemon_mode' option is dependent on the
other values.

The fact that these parameters are translated into a 'struct
upload_pack_data' immediately within upload_pack() shows that these
can be grouped into a "context" object for internal use without
needing this pattern for the method signature.

Works for me.

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