Re: [PATCH v2 11/21] bisect: use struct node_data array instead of int array

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

 



On Sun, Apr 10, 2016 at 3:19 PM, Stephan Beyer <s-beyer@xxxxxxx> wrote:
>
> @@ -321,14 +321,13 @@ static struct commit_list *do_find_bisection(struct commit_list *list,
>                          * add one for p itself if p is to be counted,
>                          * otherwise inherit it from q directly.
>                          */
> +                       node_data(p->item)->weight = node_data(q->item)->weight;
>                         if (!(flags & TREESAME)) {
> -                               weight_set(p, weight(q)+1);
> +                               node_data(p->item)->weight++;

It is not so easy to see that the above does the same thing as before.

Maybe review would be easier if this part of the code was simplified
in a separate patch and/or if the weight() and weight_set() function
were kept, maybe like this:

static inline int weight(struct commit *elem)
{
       return node_data(elem)->weight;
}

static inline void set_weight(struct commit *elem, int weight)
{
       node_data(elem)->weight = weight;
}

>                                 counted++;
>                                 show_list("bisection 2 count one",
>                                           counted, nr, list);
>                         }
> -                       else
> -                               weight_set(p, weight(q));
>
>                         /* Does it happen to be at exactly half-way? */
>                         if (!find_all && halfway(p, nr))
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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]