]> git.ipfire.org Git - thirdparty/git.git/commitdiff
reftable/reader: stop using `ARRAY_SIZE()` macro
authorPatrick Steinhardt <ps@pks.im>
Tue, 18 Feb 2025 09:20:46 +0000 (10:20 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Feb 2025 18:55:37 +0000 (10:55 -0800)
We have a single user of the `ARRAY_SIZE()` macro in the reftable
reader. Drop its use to reduce our dependence on the Git codebase.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
reftable/reader.c

index bf07a0a586fd6ff13b969a388c39003d4d77f41a..c3a367466529db1cfc1b887fad0a18185f874d00 100644 (file)
@@ -849,7 +849,7 @@ int reftable_reader_print_blocks(const char *tablename)
        printf("header:\n");
        printf("  block_size: %d\n", r->block_size);
 
-       for (i = 0; i < ARRAY_SIZE(sections); i++) {
+       for (i = 0; i < sizeof(sections) / sizeof(*sections); i++) {
                err = table_iter_seek_start(&ti, sections[i].type, 0);
                if (err < 0)
                        goto done;