Re: [PATCH 11/11] strvec: rename struct fields
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Jul 29, 2020, 06:55 UTC
- Message-ID
- <CAP8UFD3Z86nQq_iZ3kqvuL4Vr9PxL+71VBgd7my+YUxgFyYvXA@mail.gmail.com>
- In-Reply-To
- <xmqqmu3jcp9u.fsf@gitster.c.googlers.com>
On Tue, Jul 28, 2020 at 11:19 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 15 quoted lines
> > Junio C Hamano <gitster@pobox.com> writes: > > >> I'm actually not that fond of "items". I almost went with just: > >> > >> const char **v; > >> > >> as the variable name which contains it usually provides sufficient > >> context. But I worried that people would consider that too inscrutable. > > > > I'd agree that v[] is a good name. If it is too short, I can live > > with item[], but not with items[].... > > What are individual component of a vector called? An element? If > so, elem[] would be much better name than item[].
Individual components of a string vector or a string array are strings, so "str" if we abbreviate "string" to "str".
Using "str" would be consistent with oid_array where the individual component is called "oid" as it is defined this way:
struct oid_array {
struct object_id *oid;
size_t nr;
size_t alloc;
int sorted;
};