Re: [PATCH 4/4] transport: mark unused parameters in fetch_refs_from_bundle()

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

 



Jeff King <peff@xxxxxxxx> writes:

> We don't look at the "to_fetch" or "nr_heads" parameters at all. At
> first glance this seems like a bug (or at least pessimisation), because
> it means we fetch more objects from the bundle than we actually need.
> But the bundle does not have any way of computing the set of reachable
> objects itself (we'd have to pull all of the objects out to walk them).
> And anyway, we've probably already paid most of the cost of grabbing the
> objects, since we must copy the bundle locally before accessing it.
>
> So it's perfectly reasonable for the bundle code to just pull everything
> into the local object store. Unneeded objects can be dropped later via
> gc, etc.
>
> But we should mark these unused parameters as such to avoid the wrath of
> -Wunused-parameter.

Very well described, and I agree with the reasoning.

Will queue all four.  Thanks.

>
> Signed-off-by: Jeff King <peff@xxxxxxxx>
> ---
>  transport.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/transport.c b/transport.c
> index 81950bf755f..c5abf26f31e 100644
> --- a/transport.c
> +++ b/transport.c
> @@ -167,7 +167,8 @@ static struct ref *get_refs_from_bundle(struct transport *transport,
>  }
>  
>  static int fetch_refs_from_bundle(struct transport *transport,
> -			       int nr_heads, struct ref **to_fetch)
> +				  int nr_heads UNUSED,
> +				  struct ref **to_fetch UNUSED)
>  {
>  	struct bundle_transport_data *data = transport->data;
>  	struct strvec extra_index_pack_args = STRVEC_INIT;



[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