Skip to content

Commit abcddce

Browse files
Chandra Pratapgitster
authored andcommitted
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 <[email protected]> Mentored-by: Christian Couder <[email protected]> Signed-off-by: Chandra Pratap <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 29ee6d5 commit abcddce

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

t/unit-tests/t-reftable-block.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ static void t_block_read_write(void)
2929
int ret;
3030
struct block_reader br = { 0 };
3131
struct block_iter it = BLOCK_ITER_INIT;
32-
size_t j = 0;
3332
struct strbuf want = STRBUF_INIT;
3433

3534
REFTABLE_CALLOC_ARRAY(block.data, block_size);
@@ -64,15 +63,14 @@ static void t_block_read_write(void)
6463

6564
block_iter_seek_start(&it, &br);
6665

67-
while (1) {
66+
for (i = 0; ; i++) {
6867
ret = block_iter_next(&it, &rec);
6968
check_int(ret, >=, 0);
7069
if (ret > 0) {
7170
check_int(i, ==, N);
7271
break;
7372
}
74-
check(reftable_record_equal(&recs[j], &rec, GIT_SHA1_RAWSZ));
75-
j++;
73+
check(reftable_record_equal(&recs[i], &rec, GIT_SHA1_RAWSZ));
7674
}
7775

7876
for (i = 0; i < N; i++) {

0 commit comments

Comments
 (0)