Re: [PATCH 1/3] pack-bitmap: deduplicate logic to iterate over preferred bitmap tips
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 29, 2026, 16:35 UTC
- Message-ID
- <xmqqecn8cr7e.fsf@gitster.g>
- In-Reply-To
- <aXrDD1H4lvBR1sF8@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
Show 12 quoted lines
>> +void for_each_preferred_bitmap_tip(struct repository *repo,
>> + each_ref_fn cb, void *cb_data)
>> +{
>> + struct string_list_item *item;
>> + const struct string_list *preferred_tips;
>> +
>> + preferred_tips = bitmap_preferred_tips(repo);
>
> OK, so this is the sole caller of bitmap_preferred_tips() you were
> referring to earlier. That function's implementation is hidden from the
> diff context, but it's effectively a thin wrapper around
> repo_config_get_string_multi().True. I found it easier to see from the way the patch was written that this is a pure refactoring patch, though. IOW, we may want to do that on top as a further rewrite, but I am not sure if it makes the result easier to reason about. Such helper functions that are file-scope static often help reading the logic flow of the program, and compilers would inline them when it is more beneficial anyway.