Re: [PATCH v2 4/8] repack: use a sorted list for explicitly kept packs
On Wed, Sep 30, 2026 at 11:11:47PM -0500, Taylor Blau wrote:
Show 12 quoted lines
> `existing_packs_collect()` performs a linear search through the
> '--keep-pack' arguments for each local pack. Typically the number of
> such arguments is small enough that the difference between a linear and
> binary search is just noise (especially compared with the amount of work
> that 'repack' is about to perform).
>
> However, an additional caller will wish to search through the same list.
> To prevent that caller from having to duplicate the clunky for-loop in
> `existing_packs_collect()`, sort the list using `fspathcmp()` and
> replace the existing caller's loop with `string_list_has_string()`.
>
> This does not change the overall behavior of '--keep-pack' arguments.
OK, makes sense, and the patch looks correct.
-Peff