Re: [PATCH v3 02/19] convert: add [async_]convert_to_working_tree_ca() variants

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

 



Matheus Tavares <matheus.bernardino@xxxxxx> writes:

> -static int convert_to_working_tree_internal(const struct index_state *istate,
> +static int convert_to_working_tree_internal(const struct conv_attrs *ca,

Makes sense.  Once we know conv_attrs, we do not need the istate to
convert the contents.

> @@ -1497,7 +1494,9 @@ int async_convert_to_working_tree(const struct index_state *istate,
>  				  const struct checkout_metadata *meta,
>  				  void *dco)
>  {
> -	return convert_to_working_tree_internal(istate, path, src, len, dst, 0, meta, dco);
> +	struct conv_attrs ca;
> +	convert_attrs(istate, &ca, path);
> +	return convert_to_working_tree_internal(&ca, path, src, len, dst, 0, meta, dco);
>  }
>
> @@ -1505,13 +1504,36 @@ int convert_to_working_tree(const struct index_state *istate,
>  			    size_t len, struct strbuf *dst,
>  			    const struct checkout_metadata *meta)
>  {
> -	return convert_to_working_tree_internal(istate, path, src, len, dst, 0, meta, NULL);
> +	struct conv_attrs ca;
> +	convert_attrs(istate, &ca, path);
> +	return convert_to_working_tree_internal(&ca, path, src, len, dst, 0, meta, NULL);
> +}

OK, these naturally implement "let's lift convert_attrs() out of the
callee and move it to the callers".  However...

> +int async_convert_to_working_tree_ca(const struct conv_attrs *ca,
> +				     const char *path, const char *src,
> +				     size_t len, struct strbuf *dst,
> +				     const struct checkout_metadata *meta,
> +				     void *dco)
> +{
> +	return convert_to_working_tree_internal(ca, path, src, len, dst, 0, meta, dco);
> +}
> +
> +int convert_to_working_tree_ca(const struct conv_attrs *ca,
> +			       const char *path, const char *src,
> +			       size_t len, struct strbuf *dst,
> +			       const struct checkout_metadata *meta)
> +{
> +	return convert_to_working_tree_internal(ca, path, src, len, dst, 0, meta, NULL);
>  }

... shouldn't they be implemented as thin wrappers around these new
*_ca() variants of the API functions?  Otherwise, the *_ca()
variants are not yet used by anybody yet at this step, are they?



[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