Re: [PATCH 03/44] connect: have ref processing code take struct packet_reader
- From
- Martin Ågren <martin.agren@gmail.com>
- Date
- May 13, 2020, 19:30 UTC
- Message-ID
- <CAN0heSrtV15dxhKMeePbbD42FzWbnw2kRe+nKwuzzJJszvwi0A@mail.gmail.com>
- In-Reply-To
- <20200513005424.81369-4-sandals@crustytoothpaste.net>
On Wed, 13 May 2020 at 02:56, brian m. carlson <sandals@crustytoothpaste.net> wrote:
Show 5 quoted lines
> > In a future patch, we'll want to access multiple members from struct > packet_reader when parsing references. Therefore, have the ref parsing > code take pointers to struct reader instead of having to pass multiple > arguments to each function.
Makes sense.
Show 7 quoted lines
> -static void process_capabilities(const char *line, int *len)
> +static void process_capabilities(struct packet_reader *reader, int *len)
> {
> + const char *line = reader->line;
> int nul_location = strlen(line);
> if (nul_location == *len)
> return;"line+len" made it pretty obvious that they belonged together. "reader+len" not so much. Your patch does minimize the change. Would s/len/linelen/ be worth the extra churn? Possibly not. Right now, at least we're pretty consistent about using "len" -- if this ends up as a mixture of "linelen" and "len" I think it's worse, overall.
Martin