Re: [PATCH v7 0/5] Make the "promisor-remote" capability support more fields

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

 



Christian Couder <christian.couder@xxxxxxxxx> writes:

> Here are the changes compared to v6:

All looked sensible.  Especially ...

>     -+  struct strbuf **elems = strbuf_split(remote_info, ',');
>     ++  struct string_list elem_list = STRING_LIST_INIT_NODUP;
>     ++  struct string_list_item *item;
>      +
>     -+  for (size_t i = 0; elems[i]; i++) {
>     -+          char *elem = elems[i]->buf;
>     ++  string_list_split_in_place(&elem_list, remote_info->buf, ",", -1);

... because of this change, we do not have to do ...

>     -+          strbuf_strip_suffix(elems[i], ",");

... this, which is very nice.  Unlike string_list_split_in_place()
that can take multiple delimiter bytes, strbuf_split() can take only
a single byte as the delimiter, so leaving it at the end of each
split pieces does not make much sense (at least, that is done not
because we do not want to lose information), and having to strip the
suffix after splitting always felt like papering over a wrong
behaviour of the helper function.





[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