Re: [PATCH 11/11] strvec: rename struct fields

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

 



On Tue, Jul 28, 2020 at 02:16:24PM -0700, Junio C Hamano wrote:

> > 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[].  Clearly we are mostly accessing
> one element at a time much more often than treating the set as a
> whole, so signaling "there are multiple things in the set" with
> a plural name is much less important than being able to say item[4]
> to name the 4th item in the collection.

I'd worry that "item" versus string_list "items" would be unfriendly
(though I am not opposed to changing string_list to match).

Your "elem" suggestion from elsewhere may be better still, but if you
are OK with "v",  that is my preference. I'll see if anybody else chimes
in, but if not, then I'd probably switch to that. :)

-Peff



[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