hashmap: convert sha1hash() to oidhash()
There are no callers left of sha1hash() that do not simply pass the "hash" member of a "struct object_id". Let's get rid of the outdated sha1-specific function and provide one that operates on the whole struct (even though the technique, taking the first few bytes of the hash, will remain the same). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
c0566d78aa
commit
d40abc8e95
@ -76,7 +76,7 @@ static int commit_name_neq(const void *unused_cmp_data,
|
||||
|
||||
static inline struct commit_name *find_commit_name(const struct object_id *peeled)
|
||||
{
|
||||
return hashmap_get_from_hash(&names, sha1hash(peeled->hash), peeled);
|
||||
return hashmap_get_from_hash(&names, oidhash(peeled), peeled);
|
||||
}
|
||||
|
||||
static int replace_name(struct commit_name *e,
|
||||
@ -123,7 +123,7 @@ static void add_to_known_names(const char *path,
|
||||
if (!e) {
|
||||
e = xmalloc(sizeof(struct commit_name));
|
||||
oidcpy(&e->peeled, peeled);
|
||||
hashmap_entry_init(e, sha1hash(peeled->hash));
|
||||
hashmap_entry_init(e, oidhash(peeled));
|
||||
hashmap_add(&names, e);
|
||||
e->path = NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user