diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2017-08-26 10:28:11 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-26 09:21:01 -0700 |
commit | cfdc88f1a34ccb8e59899501b0ede875afac0d83 (patch) | |
tree | b9ae15a82d3b2002e34fb63e4a57aacedf9a1277 /trace.h | |
parent | get_oid_hex_segment(): don't pad the rest of `oid` (diff) | |
download | tgif-cfdc88f1a34ccb8e59899501b0ede875afac0d83.tar.xz |
hex_to_bytes(): simpler replacement for `get_oid_hex_segment()`
Now that `get_oid_hex_segment()` does less, it makes sense to rename
it and simplify its semantics:
* Instead of a `hex_len` parameter, which was the number of hex
characters (and had to be even), use a `len` parameter, which is the
number of resulting bytes. This removes then need for the check that
`hex_len` is even and to divide it by two to determine the number of
bytes. For good hygiene, declare the `len` parameter to be `size_t`
instead of `unsigned int`.
* Change the order of the arguments to the more traditional (dst,
src, len).
* Rename the function to `hex_to_bytes()`.
* Remove a loop variable: just count `len` down instead.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'trace.h')
0 files changed, 0 insertions, 0 deletions