Subject: Re: [PATCH v3 7/9] commit: add short-circuit to paint_down_to_common()

From: Jakub Narebski <[email-masked]>
Date: Thu, 19 Apr 2018 10:32:05 +0200

Derrick Stolee <[email-masked]> writes:

> @@ -876,7 +886,7 @@ static struct commit_list *merge_bases_many(struct commit *one, int n, struct co
>  			return NULL;
>  	}
>  
> -	list = paint_down_to_common(one, n, twos);
> +	list = paint_down_to_common(one, n, twos, 0);
>  
>  	while (list) {
>  		struct commit *commit = pop_commit(&list);
> @@ -943,7 +953,7 @@ static int remove_redundant(struct commit **array, int cnt)
>  			filled_index[filled] = j;
>  			work[filled++] = array[j];
>  		}
> -		common = paint_down_to_common(array[i], filled, work);
> +		common = paint_down_to_common(array[i], filled, work, 0);
>  		if (array[i]->object.flags & PARENT2)
>  			redundant[i] = 1;
>  		for (j = 0; j < filled; j++)

Wouldn't it be better and more readable to create a symbolic name for
this 0, for example:

  -	list = paint_down_to_common(one, n, twos);
  +	list = paint_down_to_common(one, n, twos, GENERATION_NO_CUTOFF);

Best,
-- 
Jakub Narębski