Re: Fix up ugly open-coded "alloc_nr()" user in object.c
On Sat, Jun 16, 2007 at 02:21:34PM -0400, Jeff King wrote:
> How about using the new ALLOC_GROW macro to make it even shorter? I also
> got rid of the aliased variables, which IMO just make it harder to see
Show 6 quoted lines
> what's going on.
> + ALLOC_GROW(array->objects, array->nr, array->alloc);
> + array->objects[array->nr].item = obj;
> + array->objects[array->nr].name = name;
> + array->objects[array->nr].mode = mode;
> + array->nr++;
Unless the ALLOC_GROW semantics are weird, shouldn't that be:
ALLOC_GROW(array->objects, array->nr+1, array->alloc);
OG.