mirror of
https://github.com/git/git.git
synced 2026-01-09 17:46:37 +00:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
ed3305fff7
commit
e78ab37054
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user