diff options
author | Patrick Steinhardt <ps@pks.im> | 2024-02-06 07:35:46 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-02-06 21:10:08 +0100 |
commit | 81879123c32d06406de5bfaf68baf6029660ca2a (patch) | |
tree | de72790ca9f01e54bcb7e0a1f73298939f771ae6 /reftable/basics.c | |
parent | reftable/stack: use `size_t` to track stack slices during compaction (diff) | |
download | git-81879123c32d06406de5bfaf68baf6029660ca2a.tar.xz git-81879123c32d06406de5bfaf68baf6029660ca2a.zip |
reftable/stack: use `size_t` to track stack length
While the stack length is already stored as `size_t`, we frequently use
`int`s to refer to those stacks throughout the reftable library. Convert
those cases to use `size_t` instead to make things consistent.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'reftable/basics.c')
-rw-r--r-- | reftable/basics.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/reftable/basics.c b/reftable/basics.c index af9004cec2..0785aff941 100644 --- a/reftable/basics.c +++ b/reftable/basics.c @@ -64,12 +64,11 @@ void free_names(char **a) reftable_free(a); } -int names_length(char **names) +size_t names_length(char **names) { char **p = names; - for (; *p; p++) { - /* empty */ - } + while (*p) + p++; return p - names; } |