Re: [PATCH 11/11] strvec: rename struct fields
- From
Jeff King <peff@peff.net>
- Date
- Jul 29, 2020, 16:34 UTC
- Message-ID
- <20200729163419.GC2320983@coredump.intra.peff.net>
- In-Reply-To
- <CAP8UFD3Z86nQq_iZ3kqvuL4Vr9PxL+71VBgd7my+YUxgFyYvXA@mail.gmail.com>
On Wed, Jul 29, 2020 at 08:55:46AM +0200, Christian Couder wrote:
Show 18 quoted lines
> > > 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;
> };Yeah, I agree "str" is a reasonable name, and probably better than "elem" or "items". I do still like the super-concise "v" better, though.
-Peff