aboutsummaryrefslogtreecommitdiff
path: root/sha1_file.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-07-13 16:14:54 -0700
committerJunio C Hamano <gitster@pobox.com>2017-07-13 16:14:54 -0700
commit91f69225443b3be8d3f11c5c71795169d7d00737 (patch)
tree7c891653d8fb17dfb29641cc8e56385064816e94 /sha1_file.c
parenteac97b438c6734304c155604f4c36ac63f29ca6f (diff)
parent1ecbf31d0298a1ed952623108e23234d5cf37086 (diff)
downloadgit-91f69225443b3be8d3f11c5c71795169d7d00737.tar.gz
git-91f69225443b3be8d3f11c5c71795169d7d00737.tar.xz
Merge branch 'sb/hashmap-customize-comparison'
Update the hashmap API so that data to customize the behaviour of the comparison function can be specified at the time a hashmap is initialized. * sb/hashmap-customize-comparison: hashmap: migrate documentation from Documentation/technical into header patch-ids.c: use hashmap correctly hashmap.h: compare function has access to a data field
Diffstat (limited to 'sha1_file.c')
-rw-r--r--sha1_file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sha1_file.c b/sha1_file.c
index 5862386cd..fca165f13 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -2275,7 +2275,8 @@ static int delta_base_cache_key_eq(const struct delta_base_cache_key *a,
return a->p == b->p && a->base_offset == b->base_offset;
}
-static int delta_base_cache_hash_cmp(const void *va, const void *vb,
+static int delta_base_cache_hash_cmp(const void *unused_cmp_data,
+ const void *va, const void *vb,
const void *vkey)
{
const struct delta_base_cache_entry *a = va, *b = vb;
@@ -2360,7 +2361,7 @@ static void add_delta_base_cache(struct packed_git *p, off_t base_offset,
list_add_tail(&ent->lru, &delta_base_cache_lru);
if (!delta_base_cache.cmpfn)
- hashmap_init(&delta_base_cache, delta_base_cache_hash_cmp, 0);
+ hashmap_init(&delta_base_cache, delta_base_cache_hash_cmp, NULL, 0);
hashmap_entry_init(ent, pack_entry_hash(p, base_offset));
hashmap_add(&delta_base_cache, ent);
}