Re: [PATCH 16/17] pathspec: small readability changes
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Dec 8, 2016, 09:23 UTC
- Message-ID
- <CACsJy8BFkB1Ga3PJ-QccVUoE2L14CB2g4MoapVu-QFi3c9CQQw@mail.gmail.com>
- In-Reply-To
- <20161207232724.GI116201@google.com>
On Thu, Dec 8, 2016 at 6:27 AM, Brandon Williams <bmwill@google.com> wrote:
Show 31 quoted lines
>> On Wed, Dec 7, 2016 at 4:51 AM, Brandon Williams <bmwill@google.com> wrote:
>> > @@ -362,8 +368,6 @@ static unsigned prefix_pathspec(struct pathspec_item *item,
>> > } else {
>> > item->original = xstrdup(elt);
>> > }
>> > - item->len = strlen(item->match);
>> > - item->prefix = prefixlen;
>> >
>> > if (flags & PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP)
>> > strip_submodule_slash_cheap(item);
>> > @@ -371,13 +375,14 @@ static unsigned prefix_pathspec(struct pathspec_item *item,
>> > if (flags & PATHSPEC_STRIP_SUBMODULE_SLASH_EXPENSIVE)
>> > strip_submodule_slash_expensive(item);
>> >
>> > - if (magic & PATHSPEC_LITERAL)
>> > + if (magic & PATHSPEC_LITERAL) {
>> > item->nowildcard_len = item->len;
>> > - else {
>> > + } else {
>> > item->nowildcard_len = simple_length(item->match);
>> > if (item->nowildcard_len < prefixlen)
>> > item->nowildcard_len = prefixlen;
>> > }
>> > +
>> > item->flags = 0;
>>
>> You probably can move this line up with the others too.
>
> I didn't move the item->flags assignment up since the code immediately
> following this assignment deal with setting item->flags. I made more
> sense to keep them grouped.It's probably why I put it there in the beginning :) Yes let's leave it where it is then.
-- Duy