git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] commit: use commit_list_append() instead of duplicating its code
@ 2014-07-10  9:47 René Scharfe
  0 siblings, 0 replies; only message in thread
From: René Scharfe @ 2014-07-10  9:47 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Junio C Hamano, Thomas Rast

Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
 commit.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/commit.c b/commit.c
index fb7897c..61d2e13 100644
--- a/commit.c
+++ b/commit.c
@@ -447,12 +447,7 @@ struct commit_list *copy_commit_list(struct commit_list *list)
 	struct commit_list *head = NULL;
 	struct commit_list **pp = &head;
 	while (list) {
-		struct commit_list *new;
-		new = xmalloc(sizeof(struct commit_list));
-		new->item = list->item;
-		new->next = NULL;
-		*pp = new;
-		pp = &new->next;
+		pp = commit_list_append(list->item, pp);
 		list = list->next;
 	}
 	return head;
-- 
2.0.0

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-07-10  9:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-10  9:47 [PATCH] commit: use commit_list_append() instead of duplicating its code René Scharfe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).