Commit 577aeef7 by Edward Thomson Committed by GitHub

Merge pull request #4328 from libgit2/peff/hashcmp-is-memcmp

oid: use memcmp in git_oid__hashcmp
parents f908b184 c9b1e646
......@@ -22,14 +22,7 @@ char *git_oid_allocfmt(const git_oid *id);
GIT_INLINE(int) git_oid__hashcmp(const unsigned char *sha1, const unsigned char *sha2)
{
int i;
for (i = 0; i < GIT_OID_RAWSZ; i++, sha1++, sha2++) {
if (*sha1 != *sha2)
return *sha1 - *sha2;
}
return 0;
return memcmp(sha1, sha2, GIT_OID_RAWSZ);
}
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment