diff options
author | Jeff King <peff@peff.net> | 2019-02-14 00:51:03 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-02-14 15:26:15 -0800 |
commit | 5c326d12524e4395b0ff184123e71738db6c9f65 (patch) | |
tree | 48bc43e835498a5d69591b0da04f40b8c7af8841 /Documentation/technical/protocol-capabilities.txt | |
parent | ref-filter: drop unused "obj" parameters (diff) | |
download | tgif-5c326d12524e4395b0ff184123e71738db6c9f65.tar.xz |
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 'Documentation/technical/protocol-capabilities.txt')
0 files changed, 0 insertions, 0 deletions