Re: [RFC PATCH v2 2/4] ref-filter API user: add and use a ref_sorting_release()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 20, 2021, 14:39 UTC
- Message-ID
- <xmqqpmrzrcah.fsf@gitster.g>
- In-Reply-To
- <RFC-patch-v2-2.4-0ae71c19ab7-20211020T131627Z-avarab@gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 7 quoted lines
> +void ref_sorting_release(struct ref_sorting *sorting)
> +{
> + struct ref_sorting *next = sorting->next;
> + if (next)
> + ref_sorting_release(next);
> + free(sorting);
> +}Looks like a deep recursion that can be turned into an iteration fairly easily? I guess it does not matter as long as we won't deal with thousands of sort keys...