Thread (5 messages) flat view 5 messages, 2 authors, 2016-06-15

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

From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:50:16

On Tue, Dec 14, 2010 at 8:48 AM, Thiago Farina [off-list ref] 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help