Re: [PATCH] builtin/rm.c: Use ALLOC_GROW instead of alloc_nr and xrealloc.

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

 



On Tue, Dec 14, 2010 at 8:48 AM, Thiago Farina <tfransosi@xxxxxxxxx> wrote:
> Âstatic void add_list(const char *name)
> Â{
> - Â Â Â if (list.nr >= list.alloc) {
> - Â Â Â Â Â Â Â list.alloc = alloc_nr(list.alloc);
> - Â Â Â Â Â Â Â list.name = xrealloc(list.name, list.alloc * sizeof(const char *));
> - Â Â Â }
> + Â Â Â ALLOC_GROW(list.name, list.nr + 1, list.alloc);
> Â Â Â Âlist.name[list.nr++] = name;
> Â}

add_list() is only used at one place, why not remove it and put the
code back in cmd_rm()?
-- 
Duy
--
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]