]> git.ipfire.org Git - thirdparty/git.git/commit
packfile: use a `strmap` to store packs by name
authorPatrick Steinhardt <ps@pks.im>
Thu, 30 Oct 2025 10:38:38 +0000 (11:38 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 Oct 2025 14:09:52 +0000 (07:09 -0700)
commite78ab370545d81a950fa3b2701dd7c72015ee802
tree53418ee76a2581c17bc53e50a8c12087202203c7
parented3305fff7bb815fa38957735b4a644c6d594546
packfile: use a `strmap` to store packs by name

To allow fast lookups of a packfile by name we use a hashmap that has
the packfile name as key and the pack itself as value. But while this is
the perfect use case for a `strmap`, we instead use `struct hashmap` and
store the hashmap entry in the packfile itself.

Simplify the code by using a `strmap` instead.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
packfile.c
packfile.h