hashmap_cmp_fn takes hashmap_entry params
Another step in eliminating the requirement of hashmap_entry being the first member of a struct. Signed-off-by: Eric Wong <e@80x24.org> Reviewed-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
f23a465132
commit
939af16eac
@ -258,13 +258,14 @@ struct refname_hash_entry {
|
||||
};
|
||||
|
||||
static int refname_hash_entry_cmp(const void *hashmap_cmp_fn_data,
|
||||
const void *e1_,
|
||||
const void *e2_,
|
||||
const struct hashmap_entry *eptr,
|
||||
const struct hashmap_entry *entry_or_key,
|
||||
const void *keydata)
|
||||
{
|
||||
const struct refname_hash_entry *e1 = e1_;
|
||||
const struct refname_hash_entry *e2 = e2_;
|
||||
const struct refname_hash_entry *e1, *e2;
|
||||
|
||||
e1 = container_of(eptr, const struct refname_hash_entry, ent);
|
||||
e2 = container_of(entry_or_key, const struct refname_hash_entry, ent);
|
||||
return strcmp(e1->refname, keydata ? keydata : e2->refname);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user