aboutsummaryrefslogtreecommitdiffstats
path: root/t/unit-tests/t-reftable-block.c
diff options
context:
space:
mode:
authorChandra Pratap <chandrapratap3519@gmail.com>2024-08-21 18:00:58 +0530
committerJunio C Hamano <gitster@pobox.com>2024-08-21 09:41:41 -0700
commitabcddcef3dec6dc898edd30bdc0b20cfde86acb4 (patch)
treefc938c66ae54416ebca03ad4cd038e918a1d3d14 /t/unit-tests/t-reftable-block.c
parent29ee6d5a200e95df64d55a3e1fbbaa004f50c46c (diff)
downloadgit-abcddcef3dec6dc898edd30bdc0b20cfde86acb4.tar.gz
t-reftable-block: remove unnecessary variable 'j'
Currently, there are two variables for array indices, 'i' and 'j'. The variable 'j' is used only once and can be easily replaced with 'i'. Get rid of 'j' and replace its occurence with 'i'. Mentored-by: Patrick Steinhardt <ps@pks.im> Mentored-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests/t-reftable-block.c')
-rw-r--r--t/unit-tests/t-reftable-block.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/t/unit-tests/t-reftable-block.c b/t/unit-tests/t-reftable-block.c
index 81484bc646..6aa86a3edf 100644
--- a/t/unit-tests/t-reftable-block.c
+++ b/t/unit-tests/t-reftable-block.c
@@ -29,7 +29,6 @@ static void t_block_read_write(void)
int ret;
struct block_reader br = { 0 };
struct block_iter it = BLOCK_ITER_INIT;
- size_t j = 0;
struct strbuf want = STRBUF_INIT;
REFTABLE_CALLOC_ARRAY(block.data, block_size);
@@ -64,15 +63,14 @@ static void t_block_read_write(void)
block_iter_seek_start(&it, &br);
- while (1) {
+ for (i = 0; ; i++) {
ret = block_iter_next(&it, &rec);
check_int(ret, >=, 0);
if (ret > 0) {
check_int(i, ==, N);
break;
}
- check(reftable_record_equal(&recs[j], &rec, GIT_SHA1_RAWSZ));
- j++;
+ check(reftable_record_equal(&recs[i], &rec, GIT_SHA1_RAWSZ));
}
for (i = 0; i < N; i++) {