Thread (41 messages) 41 messages, 5 authors, 9d ago

Re: [PATCH v2 4/8] repack: use a sorted list for explicitly kept packs

flat view

From: Jeff King <hidden>
Date: 2026-10-02 23:16:02

On Wed, Sep 30, 2026 at 11:11:47PM -0500, Taylor Blau wrote:
`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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help