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>
Jeff King committed
Feb 18, 2009 at 22:35 UTC
66648ad7fed840adef0343a1e0bf5188d32f5569
1 file changed
+2
-2
builtin-branch.c
+2
-2
@@ -436,8 +436,8 @@ static void print_ref_list(int kinds, int detached, int verbose, int abbrev, str
436
item.kind = REF_LOCAL_BRANCH;
437
item.dest = NULL;
438
item.commit = head_commit;
439
- if (strlen(item.name) > ref_list.maxwidth)
440
- ref_list.maxwidth = strlen(item.name);
439
+ if (item.len > ref_list.maxwidth)
440
+ ref_list.maxwidth = item.len;
441
print_ref_item(&item, ref_list.maxwidth, verbose, abbrev, 1, "");
442
free(item.name);
443
}