]> git.ipfire.org Git - thirdparty/git.git/commit
midx: use `strset` for retained MIDX files
authorTaylor Blau <me@ttaylorr.com>
Tue, 19 May 2026 15:57:42 +0000 (11:57 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 May 2026 02:31:13 +0000 (11:31 +0900)
commitddaa7a6fb79038a30b59341ed3f0f2097014ccbf
tree40add0b79cb5bb0bd6216e2c25358d1b58538abe
parent22235136406ce54b752ec1aa7df76bfb00805bbc
midx: use `strset` for retained MIDX files

Both `clear_midx_files_ext()` and `clear_incremental_midx_files_ext()`
build a list of filenames to keep while pruning stale MIDX files. Today
they hand-roll an array instead of using a `strset`, thus requiring us
to pass an additional length parameter, and makes lookups linear.

Replace the bare array with a `strset` which can be passed around as a
single parameter. Though it improves lookup performance, the difference
is likely immeasurable given how small the keep_hashes array typically
is.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
midx.c