Re: [PATCH v3 7/9] commit: add short-circuit to paint_down_to_common()
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Apr 19, 2018, 08:32 UTC
- Message-ID
- <86sh7rfvga.fsf@gmail.com>
- In-Reply-To
- <20180417170001.138464-8-dstolee@microsoft.com>
Derrick Stolee <dstolee@microsoft.com> writes:
Show 18 quoted lines
> @@ -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