]> git.99rst.org Git - git.git/commit
cat-file: declare loop counter inside for()
authorEric Ju <redacted>
Fri, 24 Jul 2026 10:54:13 +0000 (12:54 +0200)
committerJunio C Hamano <redacted>
Fri, 24 Jul 2026 15:46:58 +0000 (08:46 -0700)
commitf05e099dea8ceeae5990f77ed6f4dc91d4be4694
treec5adc3b20456e823bf636ff7c94bf3682c95fbca
parent840eb9a1c54f76b1e16b249eb3f4240c3622daf3
cat-file: declare loop counter inside for()

Declare loop counters in the for statement when they are only used
within the loop body, limiting their scope and improving readability.

While updating the loop counters, use size_t instead of int for counters
that iterate over object counts.

Update the 'nr' parameter of dispatch_calls() to size_t as all callers
already pass a value of that type.

Helped-by: Christian Couder <redacted>
Signed-off-by: Eric Ju <redacted>
Signed-off-by: Pablo Sabater <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin/cat-file.c
fetch-pack.c
git clone https://git.99rst.org/PROJECT