Re: [PATCH v7 1/6] cat-file: add declaration of variable i inside its for loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 25, 2024 at 4:51 AM Patrick Steinhardt <ps@xxxxxx> wrote:
>
> On Mon, Nov 25, 2024 at 12:36:11AM -0500, Eric Ju wrote:
> > diff --git a/fetch-pack.c b/fetch-pack.c
> > index fe1fb3c1b7..bb7ec96963 100644
> > --- a/fetch-pack.c
> > +++ b/fetch-pack.c
> > @@ -1328,9 +1328,8 @@ static void write_fetch_command_and_capabilities(struct strbuf *req_buf,
> >       if (advertise_sid && server_supports_v2("session-id"))
> >               packet_buf_write(req_buf, "session-id=%s", trace2_session_id());
> >       if (server_options && server_options->nr) {
> > -             int i;
> >               ensure_server_supports_v2("server-option");
> > -             for (i = 0; i < server_options->nr; i++)
> > +             for (int i = 0; i < server_options->nr; i++)
> >                       packet_buf_write(req_buf, "server-option=%s",
> >                                        server_options->items[i].string);
> >       }
>
> It's somewhat curious that you change the type to `size_t` while at it
> in other spots, but not here. Doubly so because `server_options` is a
> `struct string_list`, and `string_list::nr` is of type `size_t`.
>
> Patrick

Thank you.

Yes, I missed that. Will correct it in v8.





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux