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:
Jeff King
2019-06-20 03:41:49 -04:00
committed by Junio C Hamano
parent c0566d78aa
commit d40abc8e95
8 changed files with 13 additions and 11 deletions

View File

@ -61,7 +61,7 @@ int type_from_string_gently(const char *str, ssize_t len, int gentle)
*/
static unsigned int hash_obj(const struct object_id *oid, unsigned int n)
{
return sha1hash(oid->hash) & (n - 1);
return oidhash(oid) & (n - 1);
}
/*