From: Karthik Nayak Date: Mon, 22 Jun 2026 10:08:29 GMT Subject: Re: [PATCH GSoC RFC v13 03/12] cat-file: declare loop counter inside for() Message-ID: In-Reply-To: <20260619-ps-eric-work-rebase-v13-3-3d4c7315d2f8@gmail.com> Pablo Sabater writes: > From: Eric Ju > > Some code used in this series declares variable i and only uses it > in a for loop, not in any other logic outside the loop. > > Change the declaration of i to be inside the for loop for readability. > While at it, we also change its type from "int" to "size_t" where the > latter makes more sense. > > Helped-by: Christian Couder > Signed-off-by: Eric Ju > Signed-off-by: Pablo Sabater > --- > builtin/cat-file.c | 13 ++++--------- > fetch-pack.c | 3 +-- > 2 files changed, 5 insertions(+), 11 deletions(-) > > diff --git a/builtin/cat-file.c b/builtin/cat-file.c > index 446d649904..fab55c11de 100644 > --- a/builtin/cat-file.c > +++ b/builtin/cat-file.c > @@ -723,14 +723,12 @@ static void dispatch_calls(struct batch_options *opt, > struct strbuf *output, > struct expand_data *data, > struct queued_cmd *cmd, > - int nr) > + size_t nr) > This is fine since both the locations that dispatch_calls() are called with, supply a size_t. The rest seems to have been already validated by Junio. Looks good [snip]