{"thread":{"id":"26047","subject":"[PATCH] builtin/branch.c: Use ALLOC_GROW instead of alloc_nr and xrealloc.","startedAt":"2010-12-14T01:59:55Z","lastAt":"2010-12-14T01:59:55Z","messageCount":1,"participants":["Thiago Farina"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"158016","messageId":"996ab205063a5e0d70c064ed43633a4f651ea9ce.1292291971.git.tfransosi@gmail.com","threadId":"26047","inReplyTo":null,"subject":"[PATCH] builtin/branch.c: Use ALLOC_GROW instead of alloc_nr and xrealloc.","fromName":"Thiago Farina","fromEmail":"tfransosi@gmail.com","sentAt":"2010-12-14T01:59:55Z","receivedAt":"2010-12-14T01:59:55Z","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/branch.c |    6 +-----\n 1 files changed, 1 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/branch.c b/builtin/branch.c\nindex 807355a..7f34fad 100644\n--- a/builtin/branch.c\n+++ b/builtin/branch.c\n@@ -314,11 +314,7 @@ static int append_ref(const char *refname, const unsigned char *sha1, int flags,\n \t}\n \n \t/* Resize buffer */\n-\tif (ref_list->index >= ref_list->alloc) {\n-\t\tref_list->alloc = alloc_nr(ref_list->alloc);\n-\t\tref_list->list = xrealloc(ref_list->list,\n-\t\t\t\tref_list->alloc * sizeof(struct ref_item));\n-\t}\n+\tALLOC_GROW(ref_list->list, ref_list->index + 1, ref_list->alloc);\n \n \t/* Record the new item */\n \tnewitem = &(ref_list->list[ref_list->index++]);\n-- \n1.7.3.2.343.g7d43d\n"}]}