From 4bbaa1eb6fb4a520069e53ec5afa977a316a5d36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Thu, 17 Jul 2014 01:52:09 +0200 Subject: use commit_list_count() to count the members of commit_lists Call commit_list_count() instead of open-coding it repeatedly. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- pretty.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'pretty.c') diff --git a/pretty.c b/pretty.c index 6e54934723..ac800fa452 100644 --- a/pretty.c +++ b/pretty.c @@ -1556,12 +1556,7 @@ static void pp_header(struct pretty_print_context *pp, } if (!parents_shown) { - struct commit_list *parent; - int num; - for (parent = commit->parents, num = 0; - parent; - parent = parent->next, num++) - ; + unsigned num = commit_list_count(commit->parents); /* with enough slop */ strbuf_grow(sb, num * 50 + 20); add_merge_info(pp, sb, commit); -- cgit v1.2.3