aboutsummaryrefslogtreecommitdiff
path: root/builtin/blame.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2014-07-17 01:52:09 +0200
committerJunio C Hamano <gitster@pobox.com>2014-07-17 13:36:25 -0700
commit4bbaa1eb6fb4a520069e53ec5afa977a316a5d36 (patch)
treeceb6d1a97ca5a3a78bb057b889b02fccaa4290fa /builtin/blame.c
parentcedc61a99804db99f9a658c3cccd5c2786a28501 (diff)
downloadgit-4bbaa1eb6fb4a520069e53ec5afa977a316a5d36.tar.gz
git-4bbaa1eb6fb4a520069e53ec5afa977a316a5d36.tar.xz
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 'builtin/blame.c')
-rw-r--r--builtin/blame.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/builtin/blame.c b/builtin/blame.c
index d3b256e54..75b3a028a 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -1371,11 +1371,8 @@ static struct commit_list *first_scapegoat(struct rev_info *revs, struct commit
static int num_scapegoats(struct rev_info *revs, struct commit *commit)
{
- int cnt;
struct commit_list *l = first_scapegoat(revs, commit);
- for (cnt = 0; l; l = l->next)
- cnt++;
- return cnt;
+ return commit_list_count(l);
}
/* Distribute collected unsorted blames to the respected sorted lists