vendor/libgit2/src/oidmap.h in rugged-0.18.0.gh.de28323 vs vendor/libgit2/src/oidmap.h in rugged-0.19.0
- old
+ new
@@ -17,20 +17,18 @@
#include "khash.h"
__KHASH_TYPE(oid, const git_oid *, void *);
typedef khash_t(oid) git_oidmap;
-GIT_INLINE(khint_t) hash_git_oid(const git_oid *oid)
+GIT_INLINE(khint_t) git_oidmap_hash(const git_oid *oid)
{
- int i;
- khint_t h = 0;
- for (i = 0; i < 20; ++i)
- h = (h << 5) - h + oid->id[i];
+ khint_t h;
+ memcpy(&h, oid, sizeof(khint_t));
return h;
}
#define GIT__USE_OIDMAP \
- __KHASH_IMPL(oid, static kh_inline, const git_oid *, void *, 1, hash_git_oid, git_oid_equal)
+ __KHASH_IMPL(oid, static kh_inline, const git_oid *, void *, 1, git_oidmap_hash, git_oid_equal)
#define git_oidmap_alloc() kh_init(oid)
#define git_oidmap_free(h) kh_destroy(oid,h), h = NULL
#endif