prefix_filename: drop length parameter
authorJeff King <peff@peff.net>
Tue, 21 Mar 2017 01:22:28 +0000 (21:22 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 21 Mar 2017 18:12:53 +0000 (11:12 -0700)
commit116fb64e439d3744d0f244a51d7a6d714b7703ae
treeec3e23445081ec7fbb0bc5b711b5066ad83b42f5
parent598019769cbaa38495b0c04297efa13d0f4a572e
prefix_filename: drop length parameter

This function takes the prefix as a ptr/len pair, but in
every caller the length is exactly strlen(ptr). Let's
simplify the interface and just take the string. This saves
callers specifying it (and in some cases handling a NULL
prefix).

In a handful of cases we had the length already without
calling strlen, so this is technically slower. But it's not
likely to matter (after all, if the prefix is non-empty
we'll allocate and copy it into a buffer anyway).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 files changed:
abspath.c
apply.c
builtin/config.c
builtin/hash-object.c
builtin/log.c
builtin/mailinfo.c
builtin/merge-file.c
builtin/rev-parse.c
builtin/worktree.c
cache.h
diff-no-index.c
diff.c
parse-options.c
setup.c
worktree.c