Re: [PATCH 3/4] push: prepare sender to receive extended ref information from the receiver

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

 



On Tue, Sep 09, 2008 at 01:27:09AM -0700, Junio C Hamano wrote:

> +struct extra_have_objects {
> +	int nr, alloc;
> +	unsigned char (*array)[20];
> +};

This declaration made me double-take. I think it is correct, and you are
saving an extra pointer over a malloc. But the syntax ends up a little
confusing:

        hashcpy(&(extra->array[extra->nr][0]), sha1);

Using a struct probably would have been a little easier to read. I don't
know if this is worth changing.

> +	if (extra->alloc <= extra->nr)
> +		ALLOC_GROW(extra->array, extra->nr + 1, extra->alloc);

Isn't the conditional superfluous (ALLOC_GROW already makes this check)?

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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