aboutsummaryrefslogtreecommitdiff
path: root/packfile.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-10-30 11:38:38 +0100
committerJunio C Hamano <gitster@pobox.com>2025-10-30 07:09:52 -0700
commite78ab370545d81a950fa3b2701dd7c72015ee802 (patch)
tree53418ee76a2581c17bc53e50a8c12087202203c7 /packfile.h
parented3305fff7bb815fa38957735b4a644c6d594546 (diff)
downloadgit-e78ab370545d81a950fa3b2701dd7c72015ee802.tar.xz
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>
Diffstat (limited to 'packfile.h')
-rw-r--r--packfile.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/packfile.h b/packfile.h
index c9d0b93446..9da7f14317 100644
--- a/packfile.h
+++ b/packfile.h
@@ -5,12 +5,12 @@
#include "object.h"
#include "odb.h"
#include "oidset.h"
+#include "strmap.h"
/* in odb.h */
struct object_info;
struct packed_git {
- struct hashmap_entry packmap_ent;
struct packed_git *next;
struct list_head mru;
struct pack_window *windows;
@@ -85,7 +85,7 @@ struct packfile_store {
* A map of packfile names to packed_git structs for tracking which
* packs have been loaded already.
*/
- struct hashmap map;
+ struct strmap packs_by_path;
/*
* Whether packfiles have already been populated with this store's