X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=hashmap.h;h=84249115664b4a3d576c619075cb8ca396fff0ed;hb=d4b12b9e07eba2e4ec1eff38a4151c9302bd1e2c;hp=f95593b6cfd7cecfbcc4584d74ac040cb355c767;hpb=747201d0c847980b3dc63eb0afc583dfac9c9d20;p=thirdparty%2Fgit.git diff --git a/hashmap.h b/hashmap.h index f95593b6cf..8424911566 100644 --- a/hashmap.h +++ b/hashmap.h @@ -1,6 +1,8 @@ #ifndef HASHMAP_H #define HASHMAP_H +#include "hash.h" + /* * Generic implementation of hash-based key-value mappings. * @@ -118,14 +120,14 @@ unsigned int memihash_cont(unsigned int hash_seed, const void *buf, size_t len); * the results will be different on big-endian and little-endian * platforms, so they should not be stored or transferred over the net. */ -static inline unsigned int sha1hash(const unsigned char *sha1) +static inline unsigned int oidhash(const struct object_id *oid) { /* - * Equivalent to 'return *(unsigned int *)sha1;', but safe on + * Equivalent to 'return *(unsigned int *)oid->hash;', but safe on * platforms that don't support unaligned reads. */ unsigned int hash; - memcpy(&hash, sha1, sizeof(hash)); + memcpy(&hash, oid->hash, sizeof(hash)); return hash; }