]> git.ipfire.org Git - thirdparty/git.git/commit
fast-import: localize 'i' into the 'for' loops using it
authorChristian Couder <christian.couder@gmail.com>
Thu, 16 Jul 2026 16:55:14 +0000 (18:55 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 16 Jul 2026 21:11:13 +0000 (14:11 -0700)
commit0892b3df6f40f798dfe9d9e4c000b027141a2cd6
treee7635204fa626e0a81036b44d788be1c89b0de56
parent1589064f3301e7a7066a08063469da7e4014c128
fast-import: localize 'i' into the 'for' loops using it

In cmd_fast_import(), a local variable 'i' is defined as an
`unsigned int` and then used as a loop counter in four different
`for (i = ...; i < ...; i++) { ... }` loops.

But in three out of the four cases, `unsigned int` isn't the best type
to use.

To give each loop counter the type matching its bound
(int/unsigned/size_t), let's localize 'i' into each loop that uses it.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fast-import.c