{"thread":{"id":"26045","subject":"[PATCH] builtin/rm.c: Use ALLOG_GROW instead of alloc_nr and xrealloc.","startedAt":"2010-12-14T01:37:17Z","lastAt":"2010-12-14T01:56:23Z","messageCount":2,"participants":["Thiago Farina"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"158013","messageId":"a09428c75202974dc69b613ae3c2096d82e5a0ca.1292290546.git.tfransosi@gmail.com","threadId":"26045","inReplyTo":null,"subject":"[PATCH] builtin/rm.c: Use ALLOG_GROW instead of alloc_nr and xrealloc.","fromName":"Thiago Farina","fromEmail":"tfransosi@gmail.com","sentAt":"2010-12-14T01:37:17Z","receivedAt":"2010-12-14T01:37:17Z","isPatch":true,"sender":{"key":"tfransosi@gmail.com","avatar":"https://avatars.githubusercontent.com/u/970071?v=4"},"body":"Signed-off-by: Thiago Farina <tfransosi@gmail.com>\n---\n builtin/rm.c |    5 +----\n 1 files changed, 1 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/rm.c b/builtin/rm.c\nindex c7b7bb3..faeedfc 100644\n--- a/builtin/rm.c\n+++ b/builtin/rm.c\n@@ -22,10 +22,7 @@ static struct {\n \n static void add_list(const char *name)\n {\n-\tif (list.nr >= list.alloc) {\n-\t\tlist.alloc = alloc_nr(list.alloc);\n-\t\tlist.name = xrealloc(list.name, list.alloc * sizeof(const char *));\n-\t}\n+\tALLOC_GROW(list.name, list.nr + 1, list.alloc);\n \tlist.name[list.nr++] = name;\n }\n \n-- \n1.7.3.2.343.g7d43d\n"},{"id":"158015","messageId":"AANLkTim7yC9ZZHBQFtRYeyABn7=BTfAdgwd6-aJhNd0c@mail.gmail.com","threadId":"26045","inReplyTo":"a09428c75202974dc69b613ae3c2096d82e5a0ca.1292290546.git.tfransosi@gmail.com","subject":"Re: [PATCH] builtin/rm.c: Use ALLOG_GROW instead of alloc_nr and xrealloc.","fromName":"Thiago Farina","fromEmail":"tfransosi@gmail.com","sentAt":"2010-12-14T01:56:23Z","receivedAt":"2010-12-14T01:56:23Z","isPatch":true,"sender":{"key":"tfransosi@gmail.com","avatar":"https://avatars.githubusercontent.com/u/970071?v=4"},"body":"On Mon, Dec 13, 2010 at 11:37 PM, Thiago Farina <tfransosi@gmail.com> wrote:\n> Signed-off-by: Thiago Farina <tfransosi@gmail.com>\n> ---\n>  builtin/rm.c |    5 +----\n>  1 files changed, 1 insertions(+), 4 deletions(-)\n>\n> diff --git a/builtin/rm.c b/builtin/rm.c\n> index c7b7bb3..faeedfc 100644\n> --- a/builtin/rm.c\n> +++ b/builtin/rm.c\n> @@ -22,10 +22,7 @@ static struct {\n>\n>  static void add_list(const char *name)\n>  {\n> -       if (list.nr >= list.alloc) {\n> -               list.alloc = alloc_nr(list.alloc);\n> -               list.name = xrealloc(list.name, list.alloc * sizeof(const char *));\n> -       }\n> +       ALLOC_GROW(list.name, list.nr + 1, list.alloc);\n>        list.name[list.nr++] = name;\n>  }\n>\n\nDisregard this, as I made a typo in the subject. Sent another patch\nwith the subject typo fixed. Thanks.\n"}]}