summaryrefslogtreecommitdiff
path: root/diff.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-02-14 05:51:03 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-02-14 23:26:15 (GMT)
commit5c326d12524e4395b0ff184123e71738db6c9f65 (patch)
tree48bc43e835498a5d69591b0da04f40b8c7af8841 /diff.h
parent25051cac802b01a588f8170e96f97bf17869177a (diff)
downloadgit-5c326d12524e4395b0ff184123e71738db6c9f65.zip
git-5c326d12524e4395b0ff184123e71738db6c9f65.tar.gz
git-5c326d12524e4395b0ff184123e71738db6c9f65.tar.bz2
ref-filter: drop unused "sz" parameters
Many of our grab_* functions, which parse the object content, take a buf/sz pair of the object bytes. However, the functions which actually parse the buffers (like find_wholine() and find_subpos()) never look at "sz", and instead use functions like strchr() and strchrnul() that assume the result is NUL-terminated. This is OK in practice (and common for Git's parsing code), since we always allocate an extra NUL when loading an object into memory (and likewise, we are OK with stopping parsing if a commit or tag contains an embedded NUL). Let's drop these extra "sz" parameters, as they are misleading about how the functions intend to access the buffer. We can drop from both the functions mentioned above, which in turn lets us drop from their callers, cascading all the way up to the top-level grab_values(). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.h')
0 files changed, 0 insertions, 0 deletions