summaryrefslogtreecommitdiff
path: root/builtin-branch.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2009-02-18 22:35:45 -0500
committerJunio C Hamano <gitster@pobox.com>2009-02-18 19:59:16 -0800
commit66648ad7fed840adef0343a1e0bf5188d32f5569 (patch)
tree8a09429c81d19c72298555277718307fe91b43bf /builtin-branch.c
parent45e2b6140147d7a8b2cd68399e4d52d5d8d7b5be (diff)
downloadgit-66648ad7fed840adef0343a1e0bf5188d32f5569.tar.gz
branch: clean up repeated strlen
Commit 45e2b61 fixed the initialization of a "len" struct parameter via strlen. We can use that to clean up what is now 3 strlens in a 6-line sequence. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-branch.c')
-rw-r--r--builtin-branch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin-branch.c b/builtin-branch.c
index 6106a1abd5..b15d3517f3 100644
--- a/builtin-branch.c
+++ b/builtin-branch.c
@@ -436,8 +436,8 @@ static void print_ref_list(int kinds, int detached, int verbose, int abbrev, str
item.kind = REF_LOCAL_BRANCH;
item.dest = NULL;
item.commit = head_commit;
- if (strlen(item.name) > ref_list.maxwidth)
- ref_list.maxwidth = strlen(item.name);
+ if (item.len > ref_list.maxwidth)
+ ref_list.maxwidth = item.len;
print_ref_item(&item, ref_list.maxwidth, verbose, abbrev, 1, "");
free(item.name);
}