Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2014-07-17 03:52:09 +0400
committerJunio C Hamano <gitster@pobox.com>2014-07-18 00:36:25 +0400
commit4bbaa1eb6fb4a520069e53ec5afa977a316a5d36 (patch)
treeceb6d1a97ca5a3a78bb057b889b02fccaa4290fa /commit.c
parentcedc61a99804db99f9a658c3cccd5c2786a28501 (diff)
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 <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/commit.c b/commit.c
index 61d2e13f48..464a139e61 100644
--- a/commit.c
+++ b/commit.c
@@ -987,12 +987,7 @@ struct commit_list *get_merge_bases_many(struct commit *one,
}
/* There are more than one */
- cnt = 0;
- list = result;
- while (list) {
- list = list->next;
- cnt++;
- }
+ cnt = commit_list_count(result);
rslt = xcalloc(cnt, sizeof(*rslt));
for (list = result, i = 0; list; list = list->next)
rslt[i++] = list->item;