summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-07-13 23:14:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-07-13 23:14:54 (GMT)
commit91f69225443b3be8d3f11c5c71795169d7d00737 (patch)
tree7c891653d8fb17dfb29641cc8e56385064816e94 /refs.c
parenteac97b438c6734304c155604f4c36ac63f29ca6f (diff)
parent1ecbf31d0298a1ed952623108e23234d5cf37086 (diff)
downloadgit-91f69225443b3be8d3f11c5c71795169d7d00737.zip
git-91f69225443b3be8d3f11c5c71795169d7d00737.tar.gz
git-91f69225443b3be8d3f11c5c71795169d7d00737.tar.bz2
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 'refs.c')
-rw-r--r--refs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/refs.c b/refs.c
index 7aae78c..ba22f4a 100644
--- a/refs.c
+++ b/refs.c
@@ -1525,7 +1525,8 @@ struct ref_store_hash_entry
char name[FLEX_ARRAY];
};
-static int ref_store_hash_cmp(const void *entry, const void *entry_or_key,
+static int ref_store_hash_cmp(const void *unused_cmp_data,
+ const void *entry, const void *entry_or_key,
const void *keydata)
{
const struct ref_store_hash_entry *e1 = entry, *e2 = entry_or_key;
@@ -1608,7 +1609,7 @@ static void register_ref_store_map(struct hashmap *map,
const char *name)
{
if (!map->tablesize)
- hashmap_init(map, ref_store_hash_cmp, 0);
+ hashmap_init(map, ref_store_hash_cmp, NULL, 0);
if (hashmap_put(map, alloc_ref_store_hash_entry(name, refs)))
die("BUG: %s ref_store '%s' initialized twice", type, name);